-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
32 lines (26 loc) · 837 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
31
32
'use strict';
var http = require('http');
var taunus = require('taunus');
var taunusExpress = require('taunus-express');
var express = require('express');
var bodyParser = require('body-parser');
var serveStatic = require('serve-static');
var realtime = require('./realtime');
var routes = require('./routes');
var app = express();
var server = http.createServer(app);
var port = process.env.PORT || 3000;
var taunusOptions = {
routes: require('./controllers/routes'),
layout: require('./.bin/views/layout')
};
app.use(serveStatic('.bin/public'));
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
realtime(server);
routes(app);
taunusExpress(taunus, app, taunusOptions);
server.listen(port, listening);
function listening () {
console.log('Giffy club running on http://localhost:%d', port);
}