Creat a .env file and add Environment Variable
PORT=YOUR PORT (Default port is 8000)
DATABASE=DB_URL
JWT_SECRET=RANDOM_STRING
Post: http://localhost:8000/api/signup
Body:
{
"name": "test1",
"email": "[email protected]",
"password": "test123"
}
Post: http://localhost:8000/api/singin
Body:
{
"name": "test1",
"password": "test123"
}
Post: http://localhost:8000/api/post/create/:uesrId
Headers:
Key: Authorization Value: Bearer YOUR_TOKEN
Key: Content-Type Value: application/json
Body:
{
"title": "First Post",
"content": "This is the Content",
"tags": ["a", "n", "sf"]
}
Put: http://localhost:8000/api/post/update/:postId/:userId
Headers:
Key: Authorization Value: Bearer YOUR_TOKEN
Key: Content-Type Value: application/json
Body:
All are optional, you can set any of those or update all
{
"title": "First Post",
"content": "This is the Content",
"tags": ["a", "n", "sf"]
}
Delete: http://localhost:8000/api/post/delete/:postId/:userId
Headers:
Key: Authorization Value: Bearer YOUR_TOKEN
Key: Content-Type Value: application/json
Post: http://localhost:8000/api/comment/:postId/:userId
Headers:
Key: Authorization Value: Bearer YOUR_TOKEN
Key: Content-Type Value: application/json
Body:
{
"comment": "Your Comment"
}