Skip to content
This repository has been archived by the owner on Dec 23, 2018. It is now read-only.

crcn/maprest.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

//mongoose schema

var maprest = require('maprest');

var Comment = {
	title : String,
	body  : String,
	date  : Date
};


var BlogPost = {
	author   : ObjectId,
	title    : String,
	body     : String
};



//mapped to:
//posts/:post
//posts/:post/comments/:comment
var mapper = maprest({
	name: 'post',
	schema: BlogPost,
	methods: ['GET','POST','PUT']
	hasMany: {
		name: 'comment',
		schema: Comment
	}
});

Api

.transform.mongooseSchema(options)

About

map objects to a restful interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published