Configure posgres DB
This commit is contained in:
29
README.md
29
README.md
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user