node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


gnome - A Simple Embeddable Node.js Blog Framework Built on Express.js and MongoDB

Build Status
###How To Install

You can easily drop gnome into your project through the package manager.

$ npm install gnome

How To Use

Server Side

You can easily integrate gnome into your express.js project.

// Set up express 
var express = require('express');
var app = express();
// Set up server homepage 
app.get('/', function(req, res) {
// Import gnome 
var gnome = require('gnome');
// Send in the express app 
// Send in the mongodb uri 
// Initialize the blog api 
// Listen 
console.log('Listening on port 8000');

Client Side

There is a client side js file that can be called via HTML. (It is dependent on jQuery)

<script src="jquery.min.js"></script>
<script src="gnome/gnomeclient.js"></script>
<script src="yourjavascript.js"></script>

There are several jQuery extensions now availible.

// Create a post 
var post = {
    title: "How To Use Node.js",
    author: "NodeNinja",
    body: "BLAHBLAHBLAH",
    tags: ['tutorials','nodejs','projects']
// Publish the post 
// Get all posts in a JSON object 
var history = $.getAllPosts();
// Get a single post by id (unique object id) 
var singlepost = $.getPostById('5265d92146b9320c02000001');

About MongoDB Configuration

gnome stores your blog posts in MongoDB, within a collection called gnomeblog