0.2.0 • Published 9 years ago

rest-wrapper v0.2.0

Weekly downloads
2
License
ISC
Repository
github
Last release
9 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

9 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

1.0.0

10 years ago