NodeJS assessment for AttainU instructor hiring
Need to pass JWT token in header of request as x-access-token. JWT token will be received in login request. 2 users are currently entered into db so use that only.
- Login request: request body:
admin user: { "email":"[email protected]", "password":"admin@123" } non-admin user:{ "email":"[email protected]", "password":"student@123" }
-
Create post: POST request body:{ "text":"hello abcdef", "author":"[email protected]" }
-
read post: GET
-
update post: POST request body:{ "author":"[email protected]", "post_id":"613f8f0e6309c64170007bd2", "text":"hello there" }
-
delete post:POST request body:{ "author":"[email protected]", "post_id":"613f883d68cf25d94d14bc1d" }