setup express boilerplate

This commit is contained in:
2025-11-14 17:40:10 -06:00
parent 072b15f3fd
commit e60c8a335c
4 changed files with 36 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
import 'dotenv/config';
import { drizzle } from 'drizzle-orm/node-postgres';
import express, { Request, Response } from "express";
// Create a connection to the database
const db = drizzle(process.env.DATABASE_URL!);
// Create a new express application instance
const app = express();
// Set the network port
const port = process.env.PORT || 3000;
// Define the root path with a greeting message
app.get("/", (req: Request, res: Response) => {
res.json({ message: "Welcome to the Express + TypeScript Server!" });
});
// Start the Express server
app.listen(port, () => {
console.log(`The server is running at http://localhost:${port}`);
});