Skip to content

liam-lloyd/express-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-demo

Dependencies

Running the Project

First, run

npm i

Then, bring up the development database with

docker-compose up
dbmate up

Then, run the project with

node app.js

Hitting Endpoints

  • 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}

Running Tests

First, build the test database using

dbmate -e TEST_DATABASE_URL up

Then, run tests with

npm test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published