An example Node/PostgreSQL application.
docker run --name some-postgres \
-e POSTGRES_USER=mild \
-e POSTGRES_PASSWORD=bitter \
-e POSTGRES_DB=ipa # Will default to POSTGRES_USER \
-p 5432:5432 \
-d postgres
Initialise the .env
file using the values used above.
cp .env.example .env
npm i
npm start
Example cURL requests can be found below.
curl -d '{"email": "foo@bar.com"}' \
-H "Content-Type: application/json" \
-X POST http://localhost:3000/users
curl http://localhost:3000/users/{user_id}
curl http://localhost:3000/users
curl -d '{"userId": "1", "dateTime": "2020-01-01 12:00:00"}' \
-H "Content-Type: application/json" \
-X POST http://localhost:3000/bookings
curl http://localhost:3000/bookings/{booking_id}
curl http://localhost:3000/bookings
curl http://localhost:3000/bookings/user/{user_id}
curl -X DELETE http://localhost:3000/bookings/{booking_id}