Skip to content

Commit

Permalink
Add ping function
Browse files Browse the repository at this point in the history
  • Loading branch information
niklauslee committed Nov 7, 2021
1 parent e835ae9 commit c4d50b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions lib/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ class Agent extends EventEmitter {
}

setup () {
http.on('request', (req, res) => {
if (req.method === 'GET' && req.url === '/ping') {
res.writeHead(200, {
'Access-Control-Allow-Origin': '*'
})
res.end('OK')
}
})

io.on('connection', socket => {
logger.info(`[socket-${socket.id}] connected`)
var session = new Session(this, socket)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kaluma-agent",
"version": "0.9.2",
"version": "0.9.3",
"author": "Minkyu Lee",
"engines": {
"node": "10.15.3"
Expand Down

0 comments on commit c4d50b5

Please sign in to comment.