Loading README.md +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ The client can connect to the socket server via `willers.digital` on port `3201` If you just want to call the REST-Server you can do it with: `https://tm-voting.willers.digital`. ## REST Services ⚠ **All parameters MUST be done in the url query `/getVotes?map=blah`** ⚠ **All parameters can be done in the url query `/getVotes?map=blah` or in the Body you sent in a JSON format `{"map":"blah"}`** **GET /getVotes**<br> Returns the current voting status for the current map.<br> Loading route/getPlayerVote.js +2 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ const path = require('path'), */ module.exports = function(app, sql, token, errorHandler) { app.get('/'+scriptName, function(req, res) { const mapId = req.query.map, player = req.query.player; const mapId = req.query.map || req.body.map, player = req.query.player || req.body.player; if (!mapId) { return errorHandler(res, 400, 'Missing map id'); } Loading route/getVotes.js +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ const path = require('path'), */ module.exports = function(app, sql, token, errorHandler) { app.get('/'+scriptName, function(req, res) { const mapId = req.query.map; const mapId = req.query.map || req.body.map; if (!mapId) { return errorHandler(res, 400, 'Missing map id'); } Loading route/setVote.js +3 −3 Original line number Diff line number Diff line Loading @@ -10,9 +10,9 @@ const path = require('path'), module.exports = function(app, sql, tokenCheck, errorHandler) { app.post('/'+scriptName, function(req, res) { //tokenCheck(req, res, sql, ()=>{ const mapId = req.query.map, player = req.query.player, vote = Number(req.query.vote); const mapId = req.query.map || req.body.map, player = req.query.player || req.body.player, vote = Number(req.query.vote || req.body.vote); if (!mapId) return errorHandler(res, 400, 'Missing map id'); if (!player) return errorHandler(res, 400, 'Missing player login'); if (!vote) return errorHandler(res, 400, 'Missing vote'); Loading Loading
README.md +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ The client can connect to the socket server via `willers.digital` on port `3201` If you just want to call the REST-Server you can do it with: `https://tm-voting.willers.digital`. ## REST Services ⚠ **All parameters MUST be done in the url query `/getVotes?map=blah`** ⚠ **All parameters can be done in the url query `/getVotes?map=blah` or in the Body you sent in a JSON format `{"map":"blah"}`** **GET /getVotes**<br> Returns the current voting status for the current map.<br> Loading
route/getPlayerVote.js +2 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ const path = require('path'), */ module.exports = function(app, sql, token, errorHandler) { app.get('/'+scriptName, function(req, res) { const mapId = req.query.map, player = req.query.player; const mapId = req.query.map || req.body.map, player = req.query.player || req.body.player; if (!mapId) { return errorHandler(res, 400, 'Missing map id'); } Loading
route/getVotes.js +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ const path = require('path'), */ module.exports = function(app, sql, token, errorHandler) { app.get('/'+scriptName, function(req, res) { const mapId = req.query.map; const mapId = req.query.map || req.body.map; if (!mapId) { return errorHandler(res, 400, 'Missing map id'); } Loading
route/setVote.js +3 −3 Original line number Diff line number Diff line Loading @@ -10,9 +10,9 @@ const path = require('path'), module.exports = function(app, sql, tokenCheck, errorHandler) { app.post('/'+scriptName, function(req, res) { //tokenCheck(req, res, sql, ()=>{ const mapId = req.query.map, player = req.query.player, vote = Number(req.query.vote); const mapId = req.query.map || req.body.map, player = req.query.player || req.body.player, vote = Number(req.query.vote || req.body.vote); if (!mapId) return errorHandler(res, 400, 'Missing map id'); if (!player) return errorHandler(res, 400, 'Missing player login'); if (!vote) return errorHandler(res, 400, 'Missing vote'); Loading