0.1.2 • Published 12 years ago

wishbone v0.1.2

Weekly downloads
70
License
-
Repository
-
Last release
12 years ago

=======

Wishbone

A dead simple way to create RESTful APIs in Node.js. Built on top of MongoDB using Backbone.js.

Installation

npm install -g wishbone

Usage

  1. Fire up mongodb sudo mongod
  2. require('wishbone')
  3. Write your code
var express = require('express'),
    http = require('http'),
    path = require('path'), 
    _ = require('underscore'),
    db = require('./db');

var app = express(),
    BaseAPI = require('./api/base');

app.configure(function(){
    app.set('port', process.env.PORT || 3000);
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.use(express.favicon());
    app.use(express.logger('dev'));
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(express.cookieParser('your secret here'));
    app.use(express.session());
    app.use(app.router);
    app.use(express.static(path.join(__dirname, 'public')));
});

app.configure('development', function(){
  app.use(express.errorHandler());
});


var scenariosAPI = new BaseAPI('scenarios', app, db);
var skusAPI = new BaseAPI('skus', app, db);
var promotionsAPI = new BaseAPI('promotions', app, db);
var historiesAPI = new BaseAPI('histories', app, db);


http.createServer(app).listen(app.get('port'), function(){
  console.log("Express server listening on port " + app.get('port'));
});
0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago

0.0.15

12 years ago

0.0.14

12 years ago

0.0.13

12 years ago

0.0.12

12 years ago

0.0.11

12 years ago

0.0.10

12 years ago

0.0.9

12 years ago

0.0.8

12 years ago

0.0.7

12 years ago

0.0.6

12 years ago

0.0.5

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago