Create a blog System Based on nodejs + NO-SQL

Source: Internet
Author: User
Tags couchdb

Preparation:

1. NO-SQL

A) cradle: couchdb client for node. js

Https://github.com/cloudhead/cradle

npm install cradle

DEMO code:

var cradle = require('cradle');var connection = new(cradle.Connection)('http://localhost', 5984, {  cache: true,  raw: false});var db = connection.database('greeting');db.get('21a9674a8667843f61d333272c3e1f00', function (err, doc) {  console.log(doc);});db.view('greeting/all', function (err, res) {  res.forEach(function (row) {      console.log("%s | %s", row.author, row.content);  });});db.view('greeting/all', { descending : true }, function (err, res) {  res.forEach(function (row) {      console.log("%s | %s", row.author, row.content);  });});

B. Mongoose: http://mongoosejs.com/

2. MVC Framework

Express: http://expressjs.com/guide.html

Railwayjs: http://railwayjs.com/

railway init blog && cd blognpm install -lrailway generate crud post title contentrailway server 8888open http://127.0.0.1:8888/posts

Towerjs: http://towerjs.org/

However, in windows, because node-WAF is required to install forever dependencies, cygwin or Linux is recommended.

npm install tower -g

tower new appcd apptower generate scaffold Post title:string body:text belongsTo:usertower generate scaffold User email:string firstName:string lastName:string hasMany:posts

Derbyjs: http://derbyjs.com/

Http://stackoverflow.com/questions/9897017/railwayjs-vs-towerjs

Unfinished, To be continued ......

References:

Http://blog.koostudios.com /? P = 398

Http://www.ianwootten.co.uk/2011/02/07/blog-rolling-with-couchdb-express-and-node-js

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.