Simple library for building JSON-based APIs fast and easily
JavaScript Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
src
tests
.gitignore
.travis.yml
LICENSE.txt
README.md
lint.json
package.json
run-coverage.sh
run-lint.sh

README.md

Build Status

nor-api -- Simple API library for Node.js

Warning! This code is experimental and in state of preliminary development. Use at your own risk.

License

It's under MIT-style open source license -- see LICENSE.txt.

Installation

You can install it simply from NPM:

npm install nor-api

Usage

First we will setup configurations (See nor-config for more details):

var config = require('nor-config').from(__dirname);
config._def('port', 3000);

And here is the actual HTTP service code:

var api = require('nor-api');
api.createServer(config, {
	'hello': 'world',
	'date': function() {
		return ''+new Date();
	}
});

Once running, our example service has resources at locations: