-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
32 lines (23 loc) · 915 Bytes
/
index.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
var express = require('express');
var wagner = require('wagner-core');
require('./models')(wagner);
require('./dependencies')(wagner);
var app = express();
app.use(require('morgan')());
wagner.invoke(require('./auth'), { app: app });
app.use('/api/v1', require('./api')(wagner));
// Serve up static HTML pages from the file system.
// For instance, '/6-examples/hello-http.html' in
// the browser will show the '../6-examples/hello-http.html'
// file.
app.use(express.static('front-end', { maxAge: 4 * 60 * 60 * 1000 /* 2hrs */ }));
// app.listen(5000);
// console.log('Listening on port 3000!');
app.set('port', (process.env.PORT || 5000));
//For avoidong Heroku $PORT error
app.get('/', function(request, response) {
var result = 'App is running'
response.send(result);
}).listen(app.get('port'), function() {
console.log('App is running, server is listening on port ', app.get('port'));
});