diff --git a/public/views/NewGame.vue.js b/public/views/NewGame.vue.js index b4a50ca..ca55376 100644 --- a/public/views/NewGame.vue.js +++ b/public/views/NewGame.vue.js @@ -33,7 +33,7 @@ export default { }) if (res.status === 200) { const game = await res.json() - location.assign(game.url) + this.$router.push({ name: 'game', params: { id: game.id } }) } } } diff --git a/server/index.js b/server/index.js index a9ea1d1..f854cfe 100644 --- a/server/index.js +++ b/server/index.js @@ -104,7 +104,7 @@ app.post('/newgame', bodyParser.json(), async (req, res) => { req.body.scoreMode ) } - res.send({ url: `/g/${gameId}` }) + res.send({ id: gameId }) }) app.use('/common/', express.static(COMMON_DIR))