You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
985 B
47 lines
985 B
const express = require('express')
|
|
const bodyParser = require('body-parser');
|
|
const app = express()
|
|
app.use(bodyParser.json());
|
|
const lobby = require("./lobby.js")
|
|
|
|
//top level
|
|
|
|
//get game list
|
|
app.get('/gamelist', function (req, res) {
|
|
res.send(lobby.list())
|
|
})
|
|
//get game details
|
|
app.get('/gamedetails', function (req, res) {
|
|
let obj=JSON.parse(req.body)
|
|
res.send(lobby.details(obj.gameID))
|
|
})
|
|
//post register player
|
|
app.post('/playerregister', function (req, res) {
|
|
let obj=req.body
|
|
res.send(lobby.register(obj.name))
|
|
})
|
|
//get an empty game made
|
|
app.post('/gamemake', function (req, res) {
|
|
let obj=JSON.parse(req.body)
|
|
res.send(lobby.register(obj.name,obj.seats,obj.ownerID))
|
|
})
|
|
//start a game
|
|
|
|
//gamelevel (??)
|
|
|
|
// get this game players
|
|
|
|
// get charity details
|
|
|
|
// get board funding details (how much money team has to work with)
|
|
|
|
// post distribution
|
|
|
|
// post accusation
|
|
|
|
// get winner
|
|
|
|
// get round status
|
|
|
|
console.log("Up")
|
|
app.listen(3000) |