Configure posgres DB

This commit is contained in:
KS Jannette
2026-05-18 18:16:14 -04:00
parent cbb76fd72d
commit f32c6d55f0
4 changed files with 6 additions and 41 deletions

View File

@@ -7,30 +7,11 @@ Express + TypeScript REST API with PostgreSQL.
```bash
cp .env.example .env
npm install
```
## Database
Start Postgres:
```bash
npm run db:up
```
Run migrations:
```bash
createdb generic_typescript_server # one-time, uses your local Postgres user
npm run db:migrate
```
Stop Postgres:
```bash
npm run db:down
```
## Dev server
```bash
npm run dev
```
Requires a local Postgres install (e.g. `brew install postgresql@16 && brew services start postgresql@16`).
Update `DATABASE_URL` in `.env` if your user, host, or database name differs.