0.0.13 • Published 11 years ago
zero-node v0.0.13
zero-node
This module helps you deal with models used in blog or other CMS easily.
Usage
- Add dependency to your module package.json file like:
{
"name" : "YOUR_MODULE_NAME",
"zero" : {
"dependencies" : {
"node" : "^0.0.1"
}
}
}- Declare
isNodein module.exports like:
module.exports = {
models : [{
identity : "post",
isNode : true
}]
}- Node module will generate brief for node content, you can specify its behavior through global configs:
{
"node" : {
auto : true, //auto generate brief for node model
field : 'content', //the key of node content to brief
toField : 'brief', //which field to save brief
limit : 300, //brief length
exclude : [], //model in this array do not need briefing
}
}- Node will add an extra
countroute for every node model. For example you declared apostnode. So there will be a route ashttp://localhost/post/countwill returns the amount of post.