초기 PM 소스 전체 업로드
This commit is contained in:
15
server.js
Normal file
15
server.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const app = require('./app');
|
||||
const http = require('http');
|
||||
const socket = require('./socket');
|
||||
|
||||
const server = http.createServer(app);
|
||||
socket.init(server); // 웹소켓 초기화
|
||||
|
||||
const env = process.env.NODE_ENV // 'development', 'production', 'individual'
|
||||
const host = env == 'production' ? process.env.PRODUCTION_IP : (env == 'individual' ? process.env.LOCAL_IP : '0.0.0.0');
|
||||
const port = env == 'production' ? process.env.PRODUCTION_PORT : (env == 'individual' ? process.env.LOCAL_PORT : '6565');
|
||||
|
||||
server.listen(port, host, (e) => {
|
||||
const displayHost = host === '0.0.0.0' ? 'localhost' : host;
|
||||
console.log(`>> Web Server Start : http://${displayHost}:${port}/ 번 포트에서 대기 중`);
|
||||
});
|
||||
Reference in New Issue
Block a user