- node
- npm
- docker
- dbmate
First, run
npm i
Then, bring up the development database with
docker-compose up
dbmate up
Then, run the project with
node app.js
- Create a user record
curl -X PUT localhost:3000/user -H "Content-Type: application/json" --data '{"name": "Joe Doe", "email": "[email protected]", "date_of_birth": "2000-01-01"}'
- Retrieve a user record
curl -X GET localhost:3000/user/{id}
- Update a user record
curl -X POST localhost:3000/user/{id} -H "Content-Type: application/json" --data '{"email": "[email protected]"}'
- Delete a user record
curl -X DELETE localhost:3000/user/{id}
First, build the test database using
dbmate -e TEST_DATABASE_URL up
Then, run tests with
npm test