- Notifications
You must be signed in to change notification settings - Fork3
JavaScript/JSON objects to REST API in minutes.
License
soygul/js-api
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Creates a REST API server from given JavaScript/JSON objects.UsesKoa for the REST API.Extendable with custom routes and middleware.
Install the package in your project directory:
npm install js-api
Start js-api server with some data:
varjsapi=require('js-api');vardata={posts:[{id:'p1',title:'first post',body:'lorem ipsum'}]};jsapi.start(data,3000);
Now browse tohttp://localhost:3000/posts and you will see the posts in JSON format.
Seeexample.js for a complete example with custom middleware and custom route definitions for resources.
You can download the entire repo and start the example directly with:
npm installnpm start
And browse tohttp://localhost:3000/posts to see the contents of the example.
MIT
About
JavaScript/JSON objects to REST API in minutes.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.