Backend service for Cornell Booked, built with Express, TypeScript, and PostgreSQL using TypeORM.
- Node.js and npm
- PostgreSQL
-
Install dependencies:
npm install
-
Create your local environment file from the example:
cp .env.example .env
Set
DB_HOST,DB_PORT,DB_USERNAME,DB_PASSWORD, andDB_NAMEin.envto match your PostgreSQL database. Do not put real credentials in.env.exampleor commit.env. -
Start the development server:
npm run dev
The server listens on port
4000by default. SetPORTin.envto use a different port.GET /healthchecks the database connection.
Compile the TypeScript application and start the compiled output:
npm run build
npm startThe build writes JavaScript to dist/. The start command runs
dist/src/app.js.
TypeORM schema synchronization is disabled, and the repository does not yet contain database migrations. The models therefore do not create database tables automatically. Add and run migrations before using application features that require those tables.