chill

0.0.1 • Public • Published

chill

easy rest mapping for express

Install

npm install chill

Usage

app.js


    var chill = require("chill")(express);

    chill.handle(require("./routes/posts"));
    chill.handle(require("./routes/comments"));

posts.js / comments.js


 	exports.path = "/posts"; // ("/comments")

 	exports.create = function(req, res) {
 		//handle post
 	}

 	exports.list = function(req, res) {
 		//handle get w/ no id
 	}

	exports.findById = function(req, res) {
		//handle get w/ req.params.id
	}

 	exports.delete = function(req, res) {
		//handle delete w/ req.params.id
 	}

 	exports.update = function(req, res) {
		//handle put w/ req.params.id
 	}

Readme

Keywords

none

Package Sidebar

Install

npm i chill

Weekly Downloads

1

Version

0.0.1

License

BSD

Last publish

Collaborators

  • benmonro