A backend server for a blog web application using MVC architecture and following basic system design principles.
This is a backend server for a blog web application that follows MVC architecture and basic system design principles. It provides REST APIs for user registration, login and CRUD operations for blog posts. The routes are protected using authentication, with only authenticated users able to create, update and delete blog posts. The server retrieves information for 10 blog posts by default, with the ability to retrieve information for a specific page of blog posts.
Watch on 1.5x Click Here
- User registration and login
- CRUD operations for blog posts
- Pagination for retrieving blog posts
POST /register
: Registers a new user.POST /login
: Logs in an existing user.
GET /
: Retrieves information for 10 blog posts by default (public route).GET /?page=2
: Retrieves information for 10 blog posts of page 2 (public route).POST /create
: Creates a new blog post (private route, requires authentication).PATCH /update?id=${id}
: Updates an existing blog post (private route, requires authentication).DELETE /delete?id=${id}
: Deletes a blog post (private route, requires authentication).
Clone the project
git clone https://github.com/subh-cs/Rest-Blog-Backend.git
Go to the project directory
cd Rest-Blog-Backend
Install dependencies
npm install
Start the server
npm run dev