//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
}
});
This repository has been archived by the owner on Dec 23, 2018. It is now read-only.
map objects to a restful interface
License
crcn/maprest.js
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
map objects to a restful interface
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published