Fixed winner / team endpoints

This commit is contained in:
Felix Albrigtsen 2022-03-25 02:43:57 +01:00
parent db3e7ed932
commit ecc66a630b
2 changed files with 2 additions and 3 deletions

View File

@ -8,7 +8,7 @@
DB_HOST=mysql.stud.ntnu.no DB_HOST=mysql.stud.ntnu.no
DB_USER=dbusername DB_USER=dbusername
DB_PASSWORD=dbpassword DB_PASSWORD=dbpassword
DB_DATABASE=dbnamei DB_DATABASE=dbname
``` ```
* Build the client (separate instructions) * Build the client (separate instructions)
* Start the server `npm start` * Start the server `npm start`

View File

@ -7,7 +7,7 @@ let tmdb = require("./tmdb.js");
// #region Express setup // #region Express setup
const app = express(); const app = express();
const port = 3000; const port = 3001;
app.listen(port, () => { app.listen(port, () => {
console.log(`Listening on port ${port}`) console.log(`Listening on port ${port}`)
}) })
@ -88,7 +88,6 @@ api.get("/match/:matchId/getMatch", (req, res) => {
.catch(err => res.send({"status": "error", "data": err})); .catch(err => res.send({"status": "error", "data": err}));
}); });
// JSON body: {"winner": teamId}
api.post("/match/:matchId/setWinner", (req, res) => { api.post("/match/:matchId/setWinner", (req, res) => {
let matchId = req.params.matchId; let matchId = req.params.matchId;
let winnerId = req.body.winnerId; let winnerId = req.body.winnerId;