0.2.0 • Published 8 years ago

rest-wrapper v0.2.0

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

rest-wrapper


Rest server used as a quick way to test a rest api, without setting up the web environment like express or koa. It provide a command line to start a web server to serve your rest apis.

Prerequisite

  • Node > 4.4
  • Rest API using generator

Install

You can install via npm.

$ npm install rest-wrapper --save

USAGE:

$ rest-wrapper [-p port] [-r] <rest dir>

Example

Suppose you have your rest apis under the directory named "test", you can add a new file to start the rest-wrapper

$ cd <path to your project>
$ rest-wrapper -p 3000 ./rest

Rest API Example

'use strict';

class hello {
  // Request example: /hello/echo?text=words
  *echo(args){
    return args.text;
  }
}

module.exports = new hello();
0.2.0

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

1.0.0

8 years ago