This is a blog API built with NodeJS and MongoDB. The API provides full CRUD (Create, Read, Update, and Delete) operations for blog posts, as well as user authentication.
To get started with this project, you can clone this repository and install the necessary dependencies. To do this, follow these steps:
- Clone the repository using git clone
https://github.com/imran99744/blog-api.git
- Install the dependencies using
npm install
To start the project, run the following command:
npm start
This will start a local development server and open the application in your default browser.
The API requires user authentication to access the full CRUD operations for blog posts. Users can sign up, log in, and log out using JSON Web Tokens (JWT).
The API provides full CRUD operations for blog posts. Users can create, read, update, and delete blog posts. Blog posts include a title, content, author, and date.
The API uses MongoDB as the database to store blog posts and user authentication information.
The following endpoints are available in the API:
POST /api/auth/register
- Sign up a new userPOST /api/auth/login
- Log in an existing user and return a JWT token
GET / - Get all blog posts
POST /api/posts
- Create a new blog postGET /api/posts/:id
- Get a specific blog post by IDPUT /api/posts/:id
- Update a specific blog post by IDDELETE /api/posts/:id
- Delete a specific blog post by ID
- NodeJS
- ExpressJS
- MongoDB