app.get('/play/:cell/:color', (req, res) => { // TODO: security let cell = req.params['cell']; let color = req.params['color']; game.grid[cell] = color; if (game.state.next == 'X') { game.state.next = 'O'; } else { game.state.next = 'X'; } res.json(game); });