mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-07-15 01:11:18 +08:00
Introduce sequelize migrations to create and migrate database tables and removed database scripts. See http://sequelizejs.com/docs/latest/migrations
Created seeds to initialize database with dummy tasks. Introduce config module to handle configurations per environment. See https://github.com/lorenwest/node-config Updated README.md to reflect changes.
This commit is contained in:
@@ -2,9 +2,9 @@ var application_root = __dirname,
|
||||
express = require('express'),
|
||||
app = express(),
|
||||
path = require('path'),
|
||||
config = require('./config'),
|
||||
orm = require('./orm').configure(config.db),
|
||||
Tasks = require('./models/task').instance(orm),
|
||||
config = require('config'),
|
||||
orm = require('./orm').configure(config.get('database')),
|
||||
Tasks = require('./db/models/task').instance(orm),
|
||||
server = require('http').createServer(app),
|
||||
io = require('socket.io').listen(server);
|
||||
|
||||
@@ -16,9 +16,8 @@ app.configure(function() {
|
||||
app.use(express.errorHandler({dumpExceptions: true, showStack: true}));
|
||||
});
|
||||
|
||||
var port = config.port;
|
||||
server.listen(port, function() {
|
||||
console.log( 'Express server listening on port %d in %s mode', port, app.settings.env );
|
||||
server.listen(config.get('port'), function() {
|
||||
console.log( 'Express server listening on port %d in %s mode', config.get('port'), app.settings.env );
|
||||
});
|
||||
|
||||
app.get('/tasks', function(req,res){
|
||||
|
||||
Reference in New Issue
Block a user