Skip to content

femilabi/chijiblog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SETUP

  • Download Node Js to your system and install
  • Clone this repository
  • Go to the project directory on your Command Line and run the command npm install
  • Download MySQL database to your system and install
  • Create database chijiblog in your MySQL database
  • Start application by running the command node index
  • Test application with the following URL http://localhost:8000

AVAILABLE ENDPOINTS AND METHODS

All requests header must contain Content-Type: application/json

  • GET - /blog -> To get all available blog posts
  • GET- /blog?page=2 -> To get available blog posts with pagination
  • POST - /post -> To create new blog post
    body
    :{
     "category_id" : "1",
    "title" : "femi is a boy not a girl",
    "content" : "ade is a girl",
    "keywords" : "ade is a girl",
    "published" : "1"
    }
  • PUT - /post/:id -> To update a particular blog post
    body :{
     "category_id" : "1",
    "title" : "femi is a boy not a girl",
    "content" : "ade is a girl",
    "keywords" : "ade is a girl",
    "published" : "1"
    }

  • GET- /post/:id -> To get a specific blog post
  • DELETE - /post/:id -> To delete a specific blog post
  • POST - /post/:post_id/comment -> To create new comment on blog post
    body :{
    "name" : "oderinwale femi",
    "message" : "This is a new post"

    }
  • PUT - /post/:post_id/comment/:id -> To update a particular comment on blog post
    body :{
    "name" : "oderinwale femi",
    "message" : "This is a new post"
    }
  • GET- /post/:post_id/comments -> To get all comments on blog post
  • DELETE - /post/:post_id/comment/:id -> To delete a specific comment on blog post

About

A small blogging API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published