App uses express and drizzle orm connected to a postgres db
Run docker compose up --build
This will start app and db
- Open seperate terminal window
- run
docker exec -ti couchsurfing-postgres-1 /bin/bash
- run
psql -U user -d db
- paste contents of
seed.sql
and hit enter
curl http://localhost:3000/users
curl http://localhost:3000/users/1
curl -X POST -H "Content-Type: application/json" -d '{"name": "John Doe", "email": "johndoe@example.com", "friends": [2, 3]}' http://localhost:3000/users
curl -X PUT -H "Content-Type: application/json" -d '{"name": "Jane Doe", "email": "janedoe@example.com", "friends": [3, 4]}' http://localhost:3000/users/1