Simple Todo list API written in Node.js. Based on this example.
Set the following environment variables in your shell:
export DB_USER=postgres
export DB_PASSWORD=mysecretpassword
export API_USER=admin
export API_PASSWORD=password
export CLIENT_SECRET=SECRET
docker run --name some-postgres -p 5432:5432 -v <absolute-path-to-directory>/data:/var/lib/postgresql/data -e POSTGRES_PASSWORD="${DB_PASSWORD}" -d postgres
node src/index.js
curl --header "Content-Type: application/json" --request POST --data '{"username":"${API_USER}","password":"{API_PASSWORD}"}' http://localhost:3000/login
curl -H 'Accept: application/json' -H "Authorization: Bearer <TOKEN>" http://localhost:3000/todos
curl --header "Content-Type: application/json" --header "Authorization: Bearer <TOKEN>" --request POST --data '{"note":"Todo"}' http://localhost:3000/todos
curl --header "Content-Type: application/json" --header "Authorization: Bearer <TOKEN>" --request DELETE http://localhost:3000/todos/<id>