projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix corr game rematch
[vchess.git]
/
server
/
routes
/
games.js
diff --git
a/server/routes/games.js
b/server/routes/games.js
index
42c15c9
..
ede0e6d
100644
(file)
--- 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");
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;
// From main hall, start game between players 0 and 1
router.post("/games", access.logged, access.ajax, (req,res) => {
const gameInfo = req.body.gameInfo;