Skip to content

Instantly share code, notes, and snippets.

@shunya shunya/web.js
Created Nov 10, 2012

Embed
What would you like to do?
var NE = require('nuby-express');
var util = require('util');
var _DEBUG = true;
module.exports = function (config, callback) {
var frame = new NE.Framework();
NE.log.set_log_file(__dirname + '/logs/nuby_express.log', {reset: true})
frame.start_load(_on_load, __dirname + "/app");
function _on_load() {
if (_DEBUG) console.log('framework loaded');
if (config){
if(config.mongoose){
frame.config.mongoose.db = config.mongoose.db;
}
}
frame.start_server(function () {
var port = frame.config.server.port;
if (config) {
if (config.port) {
port = config.port;
}
if(config.mongoose){
frame.config.mongoose.db = config.mongoose.db;
}
}
console.log('listening to port %s', port);
frame.server().listen(port);
if (callback) {
callback();
}
});
}
return frame;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.