Skip to content

chema2708/express_es6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express & ES6 REST API Boilerplate

This is a straightforward REST APIs built with ES6 and Express.

Getting Started

# clone it
git clone https://github.com/chema2708/express_es6.git
cd express-es6-rest-api

# Install dependencies
npm install --python=python2.7

# Start development live-reload server
PORT=8080 npm run dev

# Start production server:
PORT=8080 npm start

Please consider that you need to be connected to a rinkeby or geth network. This API is set to listen to http://localhost:8545 if you want a different blockchain source you can change it in the index files.

API Methods

This API has three mothods createWallet, getBalance & transaction.

  • createWallet: GET methot that receives no params and returns an object with the information of an account created, private key and public address.
  • getBalance: GET method that receives the public address param as getbalance/:id and returns tha balance in wei.
  • transaction: POST method that generates a transaction between two accounts, it receives JSON parameters for address, destionation & amount in wei, and returns an object with the result of the transaction.
{
	address: "your private key",
	destination: "the public address of the receiver",
	amount: total amount in wei
}

License

MIT

About

express and es6 rest api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published