Skip to content

PatMiracle/blogging-platform-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blogging Platform API

This project is one of the beginners' backend projects in roadmap.sh.

See also the project description).

Getting Started

Make sure you have node installed.

Create a MongoDB cluster. Create a .env file.

MONGO_URI=mongodb+srv://<username>:<password>@cluster0.z4femdq.mongodb.net/platform-blog?retryWrites=true&w=majority&appName=Cluster0

Create Blog Post

Create a new blog post using the POST method

POST /posts
{
  "title": "My First Blog Post",
  "content": "This is the content of my first blog post.",
  "category": "Technology",
  "tags": ["Tech", "Programming"]
}

Note: Category must be one of the predefined options - technology, health, lifestyle, education or food.

Update Blog Post

Update an existing blog post using the PUT method

PUT /posts/1
{
  "title": "My Updated Blog Post",
  "content": "This is the updated content of my first blog post.",
  "category": "Technology",
  "tags": ["Tech", "Programming"]
}

Delete Blog Post

Delete an existing blog post using the DELETE method

DELETE /posts/1

Get Blog Post

Get a single blog post using the GET method

GET /posts/1

Get All Blog Posts

Get all blog posts using the GET method

GET /posts

While retrieving posts, user can also filter posts by a search term. For example:

GET /posts?term=tech

About

Simple RESTful API with basic CRUD operations for a personal blogging platform.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published