This repository contains the backend code for the Newb Log application.
The base URL for all endpoints is: https://newb-log-backend.vercel.app/api/v1
-
Create Post
- URL:
/createPost
- Method:
POST
- Body:
{ "title": "My First Post", "body": "This is the content of my first post." }
- URL:
-
Create Comment
- URL:
/createComment
- Method:
POST
- Body:
{ "post": "60e610912205721e7c5a8ac9", // Example post ID "user": "JohnDoe", "body": "This is a test comment." }
- URL:
-
Like Post
- URL:
/likePost
- Method:
POST
- Body:
{ "post": "60e610912205721e7c5a8ac9", // Example post ID "user": "JaneDoe" }
- URL:
-
Unlike Post
- URL:
/unlikePost
- Method:
POST
- Body:
{ "post": "post_id_here", "like": "like_id_here" }
- URL:
-
Get All Posts
- URL:
/getallpost
- Method:
GET
- URL:
- Clone this repository to your local machine.
- Install dependencies using
npm install
. - Run the server using
npm start
. - Use the provided Postman URLs to interact with the API endpoints.