Accepts POST requests and stores them. To get stored data, send a GET request. Requires node 5.5+.
## Installation
- Clone this repository and
cd
to it. - Run
npm install
. - Run
PORT=3000 npm start
to start the server.
## Usage
- Any JSON that is sent to
http://localhost:3000
via POST will be stored:curl -X POST -H "Content-Type:application/json" -d '{"foo":"bar"}'
- Retrieve all data with a single GET request to:
http://localhost:3000
- Data is persisted to disk in
db.json
. - Extend the server for more functionality by looking at the NDDB docs.
- Watch the mini screencast.
- You can use c9.io for this (free), make sure to run below commands to get latest version of node on c9:
nvm install 5.5.0
nvm use 5.5.0
nvm alias default v5.5.0
$.ajax({ type: 'POST', processData: false, contentType: 'application/json', data: '{"name": "Guillaume"}', url: 'https://patrick-nervousnet-test-server-bitmorse.c9users.io:8080/', success: function(json) { console.log('/sayHello POST was successful.'); console.log(json); } });