-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
45 lines (36 loc) · 999 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/env node
var requirejs = require('requirejs');
requirejs.config({
// Pass the top-level main.js/index.js require
// function to requirejs so that node modules
// are loaded relative to the top-level JS file.
nodeRequire: require
});
requirejs([
'config/config.js', 'express', 'fs'
], function(config, express, fs) {
var app = express();
config.dirname = __dirname;
// var models_path = __dirname + '/app/models';
// fs.readdirSync(models_path).forEach(function (file) {
// if (~file.indexOf('.js')) {
// requirejs(models_path + '/' + file);
// }
// });
requirejs('config/everyauth')(app, config);
requirejs('config/express')(app, config);
requirejs('config/router')(app, config);
app.listen(
config.server.port,
config.server.ip,
function() {
console.log('%s: Node server started on %s:%d ...',
Date(Date.now()), config.server.ip, config.server.port
);
}
);
return app;
});
requirejs(['app/jobs/_jobs.js'], function (jobs) {
jobs.run();
});