Skip to content

A Blog post RESTful API built with NodeJs, Express and tested with JEST.

Notifications You must be signed in to change notification settings

godrowr/blog-posts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blog-posts

A RESTful API built using NodeJS, Express, Axios, request. (index.js) Tested with Jest and Supertest. (index.test.js)

installing blogposts

From github.

git clone https://github.com/godrowr/blogposts.git
cd blogposts
npm install

running blogposts

Inside your favourite terminal, do:

node src

Then proceed to http://locahost:3000

testing blogposts

npm run test

Exit through crtl-c.

routes

Two routes exist for blogposts:

Note: /api/posts must contain the query tag. ('?tag=tech')

queries for posts

tag

http://locahost:3000/api/posts?tag=tech

  • tag = { science, culture, tech, health, startups, history ...}
tags

Used for multiple tag options. http://locahost:3000/api/posts?tags=tech,health

sortBy

http://locahost:3000/api/posts?tags=tech,health&sortBy=likes

  • sortBy = {likes, id, reads, popularity}

direction

http://locahost:3000/api/posts?tag=tech&direction=asc

  • direction = {asc, desc} Where 'asc' is ascending order and 'desc' is descending order.

About

A Blog post RESTful API built with NodeJs, Express and tested with JEST.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published