Skip to content

Latest commit

 

History

History

README.md

05-database-postgres

PostgreSQL integration with IBootstrap / IShutdown lifecycle and raw SQL repositories.

Documentation

Quick start

Start PostgreSQL (Docker):

docker run --name expressots-postgres \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_DB=expressots \
  -p 5432:5432 \
  -d postgres:16
npm install
cp .env.example .env
npm run dev

Try it

curl -s -X POST http://localhost:3000/api/users \
  -H 'Content-Type: application/json' \
  -d '{"email":"alice@example.com","name":"Alice"}'

curl -s http://localhost:3000/api/users

Tests

# Skip integration tests when no database is running
SKIP_DB=true npm test

# Or run against a local postgres instance
npm test

Tests skip automatically when SKIP_DB=true or the database connection fails.