-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
29 lines (23 loc) · 1.02 KB
/
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
var express = require('express');
var path = require('path');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var log = require('./logger');
var app = express();
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
// initialize routes
require('./routes/api').initApp(app);
// Server set
var http = require('http');
//app.set('port', 30000); // 30000~30002번 포트로 지정(Nginx Load Balancing used Reverse proxy)
//app.set('port', 30001); // 30000~30002번 포트로 지정(Nginx Load Balancing used Reverse proxy)
app.set('port', 30002); // 30000~30002번 포트로 지정(Nginx Load Balancing used Reverse proxy)
var server = http.createServer(app);
server.listen(app.get('port'));
log.info('[Antenna] Application Listening on Port 30000 ~ 30002 (80 with Nginx Load Balancing used Reverse proxy)');
module.exports = app;