-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
30 lines (23 loc) · 866 Bytes
/
app.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
require('./configure');
require('app-module-path').addPath(__dirname);
//require('marko/node-require').install();
var express = require('express')
, bodyParser = require('body-parser')
, app = express()
, multer = require('multer')
, port = process.env.PORT || 8080;
app.use(require('lasso/middleware').serveStatic());
app.use(express.static(__dirname + '/public'));
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
app.use(multer({dest:'./public/uploads/'}).array('image'));
// Consolidated Routes file to avoid clobbering
require('./routes').addRoutes(app);
var isProduction = (process.env.NODE_ENV === 'production');
app.listen(port, function() {
console.log('Listening on port %d', port);
console.log('http://localhost:' + port + '/');
if (process.send) {
process.send('online');
}
});