NodeJS | Simple Tweet API

This post is about simple tweet api created using NodeJs and MongoDB. You can get a code from Github link.

Below REST APIs are provided.



We need to have Node installed before using this project. ExpressJS is used with MongoDB to store tweets.

Tech stack used - 
  • NodeJS - Backend server
  • TypeScript - Writing clean JavaScript code.
  • ESLint - Finding problematic JS code.
  • Postman - API request suit
  • MongoDB - Backend DB. 

Use below CURL urls to fetch details.
curl -H 'Content-Type: application/json' -X GET localhost:3000/api/tweets
curl -H 'Content-Type: application/json' -X GET localhost:3000/api/tweets/04e33410-09de-11ea-ba9c-832e05e78bf1
curl -H 'Content-Type: application/json' -X POST --data "{\"content\" : \"test\"}" localhost:3000/api/tweets
curl -H 'Content-Type: application/json' -X PUT --data "{\"content\" : \"updated tweet\"}" localhost:3000/api/tweets/04e33410-09de-11ea-ba9c-832e05e78bf1
curl -H 'Content-Type: application/json' -X DELETE localhost:3000/api/tweets/04e33410-09de-11ea-ba9c-832e05e78bf1

Comments

Popular posts from this blog

Spring | Using TIBCO EMS with Spring framework

TIBCO | For Loop - Accumulate output

TIBCO | JNDI Server & JMS Instance creation