0.1.0 • Published 10 years ago

node-moko v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

Node-Moko

Node-Moko is used to generate configuration for moco, and it allows you to define RESTFul API(s) in seconds.

There is a related project for ruby here.

Installation
$ npm install node-moko -g

or

$ npm install node-moko

define resources in node-moco

resource should be defined in file moko.up, the content of this file is just a simple json:

{
    "user": {
        "id": "integer",
        "description": "string"
    },
    "listing": {
        "title": "string",
        "address": "string",
        "postcode": "integer"
    }
}

this configuration defined 2 resources: users and listings.

launch:

$ mokoup generate && mokoup server

if you installed node-moko locally, you should launch it by using:

$ ./node_modules/node-moko/bin/mokoup generate
$ ./node_modules/node-moko/bin/mokoup server