czar
A light weight and flexible CMS for node.js with dead simple integration.
Last updated 3 years ago by adam_b .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install czar 
SYNC missed versions from official npm registry.

czar

A light weight and flexible CMS for node.js with dead simple integration.

Include the module, start it up within your express server and everything is handled for you.

alt tag

install

npm i -S czar

get started

Configure your server:

const express = require('express')
const path = require('path')

/* 1. Include the module. */
const CMS = require('czar')

const app = express()

/* 2. Initialise czar with your express instance. */
const cms = new CMS(app)

/* 3. Call start() with your configuration, it must be an array containing sections.
      The following example is enough to create and edit simple blog posts.
*/
cms.start([{
  name: 'blog',
  fields: [
    {type: 'text', name: 'title'},
    {type: 'textarea', name: 'body'}
  ]
}])

Visit yoursite.com/admin, create an admin login and manage your items.

Fetch the data in the front end:

$.ajax({
  method: 'POST',
  url: '/data/get/blog', /* /data/get/{page-name} */
  dataType: 'json',
  data: {
    from: 0,         /* (Optional) fetch items after an index */
    limit: 5,        /* (Optional) maximum items to fetch */
    filter: {},      /* (Optional) filter any properties */
    sort: 'created', /* (Optional) sort by a property, defaults to creation time */
    order: 'desc'    /* (Optional) order in desc or asc order, defaults to desc */
    trunc: 100       /* (Optional) truncate the fields */
  }
})
.done(function(posts) {
  /*  You have your posts! */
})

Easy!

Current Tags

  • 1.0.15                                ...           latest (3 years ago)

16 Versions

  • 1.0.15                                ...           3 years ago
  • 1.0.14                                ...           3 years ago
  • 1.0.13                                ...           3 years ago
  • 1.0.12                                ...           3 years ago
  • 1.0.11                                ...           3 years ago
  • 1.0.10                                ...           3 years ago
  • 1.0.9                                ...           3 years ago
  • 1.0.8                                ...           3 years ago
  • 1.0.7                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 2
Dependencies (17)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |