- Create a Postgres DB called nodetest.
- Modify config/config.json file with the credentials of your database.
- Execute migrations and seeders:
npm run sequelize db:migrate
ornpm run migrate
npm run sequelize db:seed:all
ornpm run seed
- Start the app with:
npm start
- Run eslint verifications with:
npm lint
- Get All Posts
GET http://localhost:3000/api/posts
- Get Post By ID
GET http://localhost:3000/api/posts/1
- Create Post
POST http://localhost:3000/api/posts
Payload:
{ "author": "Author", "title": "Title", "content": "Content" }
- Update Post
PUT http://localhost:3000/api/posts/1
Payload:
{ "author": "Author", "title": "Title", "content": "Content" }
- Delete Post