forked from pepyatka/pepyatka-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
29 lines (22 loc) · 795 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
"use strict";
require("babel/register")({
stage: 1
})
require("console-stamp")(console, 'yyyy/mm/dd HH:MM:ss.l')
var express = require('express')
, app = express()
, environment = require('./config/environment')
, http = require('http')
, server = http.createServer(app)
module.exports = app
environment.init(app)
.then(function(app) {
var PubsubListener = require('./app/pubsub-listener')
, pubsub = new PubsubListener(server, app)
var routes = require('./app/routes')(app)
var port = (process.env.PEPYATKA_SERVER_PORT || app.get('port'))
server.listen(port, function() {
app.logger.info("Express server is listening on port " + port);
app.logger.info("Server is running in " + (process.env.NODE_ENV || "development") + " mode")
})
})