-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
22 lines (18 loc) · 700 Bytes
/
Copy pathindex.js
File metadata and controls
22 lines (18 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const express = require('express')
const app = express()
const server = require('http').createServer(app)
const io = require('socket.io')(server)
const {setup} = require('./db/db')
const {MESSAGE_TYPE, logAfterExecution, log} = require('./utils/logger.utils')
const {server: {port}} = require('./config/system.config.json')
/**
* @author Ayush Srivastava <ayushs.1992@gmail.com>
*/
//bind listen with server context.
const listen = server.listen.bind(server)
setup()
.then(() => log(MESSAGE_TYPE.MESSAGE, "Starting Server."))
.then(() => logAfterExecution("Server Started Sucessfully!!", MESSAGE_TYPE.MESSAGE, listen, port))
app.get('/ping', function (req, res){
res.send('pong')
})