Skip to content

manolingam/RESTful-Web-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTful-Web-API

This project is built on private blockchain that accepts string data as input through Express.js RESTful Web API.

Tech/Framework used

Installation

Install the required dependencies using npm package manager.

npm init --yes
npm install express --save
npm install crypto-js --save
npm install level --save

How to use?

  • Run the code using node.js. node index.js
  • Using postman, make the GET and POST http requests.

POST

  • http://localhost:8000/block and the corresponding JSON body as {"body": "Testing block with test string data" }. After that you will get the corresponding output depending on your input.

GET

  • http://localhost:8000/ - Responds with all the endpoints available.
  • http://localhost:8000/block/1 (corresponding block height) - Output is a block which is given as a height in http request.
  • http://localhost:8000/chain/ - Responds with the entire blockchain.

Endpoint documentation

RESTful-Web-API - Refer for endpoint documentation.

LICENSE

MIT © Manolingam

About

RESTful Web API for private blockchain.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published