X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=server%2Froutes%2Fgames.js;h=ede0e6ddce6e96e7e984d67c23d05fb7290d42c7;hp=42c15c999dfeaae13d3326867b1fbdc419ccc09b;hb=4a2093139089632727de4f510127ef186cab528e;hpb=3cf543959e84a8a5aa3f39f4f294790e2050b3b6 diff --git a/server/routes/games.js b/server/routes/games.js index 42c15c99..ede0e6dd 100644 --- a/server/routes/games.js +++ b/server/routes/games.js @@ -5,6 +5,14 @@ const GameModel = require('../models/Game'); const access = require("../utils/access"); const params = require("../config/parameters"); +router.post("/gamestat", access.ajax, (req,res) => { + const vid = req.body.vid; + if (!!vid && !!vid.toString().match(/^[0-9]+$/)) { + GameModel.incrementCounter(vid); + res.json({}); + } +}); + // From main hall, start game between players 0 and 1 router.post("/games", access.logged, access.ajax, (req,res) => { const gameInfo = req.body.gameInfo;