forked from tesYolan/AvatarOrchestrator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
26 lines (24 loc) · 761 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
var logger = require('./models/Logger')
var Server = require('./models/Server')
var connection = require('./models/mongoose_manager.js')
process.title = 'rest_for_head'
const server = new Server()
server.listen({})
server.on('new-connection', (connection) => {
logger.info('*******************gets new connection')
connection.on('new-stream', (stream) => {
logger.info('*********reaches here also')
})
.on('close', (peerId) => {
logger.info('*************close works')
})
})
process.stdin.resume()
function exitHandler (options, err) {
if (options.cleanup) {
// TODO delete files
logger.info('Deleting files')
}
if (options.exit) process.exit()
}
process.on('SIGINT', exitHandler.bind(null, {exit: true, cleanup: true}))