|
|
|
@ -20,16 +20,17 @@ app.use(bodyParser.json(),function (req, res, next) {
|
|
|
|
|
app.get('/lobby/list' , async function (req, res) {
|
|
|
|
|
lobby.list().then(r => {
|
|
|
|
|
console.log(r)
|
|
|
|
|
res.send(JSON.stringify({gamesArr: r }))
|
|
|
|
|
})
|
|
|
|
|
console.log()
|
|
|
|
|
result=""
|
|
|
|
|
res.send(JSON.stringify({gamesArr: result }))
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//get game details
|
|
|
|
|
app.get('/lobby/details', function (req, res) {
|
|
|
|
|
app.get('/lobby/details/:gameID', function (req, res) {
|
|
|
|
|
let obj=req.body
|
|
|
|
|
res.send(lobby.details(obj.gameID))
|
|
|
|
|
lobby.details(obj.gameID).then(r => {
|
|
|
|
|
res.send(JSON.stringify(r))
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//post register player
|
|
|
|
|