2.0.0 • Published 10 years ago
drydock-boilerplate-json v2.0.0
A JSON API variant of the drydock boilerplate.
Quick Start
In one shell:
Clone this boilerplate, nuke git artifacts, npm install:
$ git clone git@github.com:TestArmada/drydock-boilerplate-json.git
$ cd drydock-boilerplate-json
$ rm -rf .git
$ npm installStart the mock from the command line:
$ node example-mock/main.jsIn another shell, test the mock's default output at GET /api/person:
$ curl http://127.0.0.1:1337/api/person; echo
{}Change the birthday value with a POST of a JSON object to /api/person:
$ curl -H "Content-Type: application/json" -X POST -d '{"birthday":"01/02/1925"}' http://127.0.0.1:1337/api/person; echo
{"status":"OK"}Test the mock's output at GET /api/person. The birthday has been updated.
$ curl http://127.0.0.1:1337/api/person; echo
{"birthday":"01/02/1925"}