Example #1
0
app.configure(function() {
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.use(express.cookieParser());
    app.use(express.bodyParser());
    app.use(express.session({store: sessionStore
        , secret: 'secret'
        , key: 'express.sid'}));
    app.use(csrf.check());
    app.use(express.methodOverride());
    app.use(require('stylus').middleware({
        src: __dirname + '/public'
    }));
    app.use(app.router);
    app.use(express.static(__dirname + '/public'));
    Model.logger.setLogLevel(7);
    Model.create_connection({
        url: 'webnote5.iriscouch.com',
        port: '80',
        db: 'core',
        auth: { // not required
          username: 'admin',
          password: 'n0mNo+es'
        }
        // secure:true,
    });
    Model.load('src/models');
});
Example #2
0
var Model = require('LazyBoy')

Model.create_connection({db:'hackathon'});

var Deal = Model.define("Deal", {
  "price" : Number,
  //"primary_type" : String,
  //"secondary_type" : String,

  "source" : String,

  //"location" : String,
  //"geolat" : Number,
  //"geolng" : Number,

  "link" : String,
  "desc" : String
});

Model.load()

exports.Deal = Deal;