A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/soygul/js-api below:

soygul/js-api: JavaScript/JSON objects to REST API in minutes.

Creates a REST API server from given JavaScript/JSON objects. Uses Koa for the REST API. Extendable with custom routes and middleware.

Install the package in your project directory:

Start js-api server with some data:

var jsapi = require('js-api');

var data = {posts: [{id: 'p1', title: 'first post', body: 'lorem ipsum'}]};

jsapi.start(data, 3000);

Now browse to http://localhost:3000/posts and you will see the posts in JSON format.

Custom Routes and Middleware

See example.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:

And browse to http://localhost:3000/posts to see the contents of the example.

MIT


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4