working database save

This commit is contained in:
Gleb Bahmutov
2013-12-21 15:31:34 -05:00
parent 7017b829a6
commit 7776dd6b45
4 changed files with 36 additions and 18 deletions

View File

@ -47,7 +47,7 @@ function createApp(db, options) {
// Enable CORS for everything
app.use(cors());
app.options('*', cors());
// Set app.router
app.use(app.router);
@ -63,6 +63,7 @@ function createApp(db, options) {
// Set database
routes.setDatabase(db);
app.db = routes.db;
// And done! Ready to serve JSON!
return app;
@ -88,7 +89,8 @@ function run(db, options) {
logger.success('Express server listening on port ' + options.port);
logger.success('Congrats! Open http://localhost:' + options.port);
});
return app;
}
exports.createApp = createApp;
exports.run = run;
exports.run = run;