- Node 14
- Postgres 11
-
Clone repo: git clone https://github.com/ezops-br/rest-api-ezops-test.git
-
Install Dependencies: npm install
-
Setup the database postgres 11
-
Run SQL file database/create.sql
-
Setup Environment variables: DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, DB_NAME
-
Run the server: node server/server.js
-
Use Postman
-
Follow the test
GET https://<yourname>.com/posts
POST https://yoururl.com/posts
{
"title" : "Post",
"content" : "Post content"
}
PUT https://yoururl.com/posts/1
{
"title" : "Edited post",
"content" : "Edited post content"
}
DELETE https://yoururl.com/posts/1