From 4640d2cd7bdbf0bf8508753c8cd3272e0ad3ba53 Mon Sep 17 00:00:00 2001 From: Ben Liu Date: Sun, 9 Jun 2024 00:44:32 +0700 Subject: [PATCH] fix(webapp): remove next page from api server --- packages/webapp/src/server.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/packages/webapp/src/server.ts b/packages/webapp/src/server.ts index 5016057f..64bb90a7 100644 --- a/packages/webapp/src/server.ts +++ b/packages/webapp/src/server.ts @@ -1,14 +1,9 @@ import { Server, Origins } from "boardgame.io/server"; -import next from 'next'; -import url from "url"; import { OpenStarTerVillage } from "./game"; async function serve() { const port = Number(process.env.PORT) || 8000; const apiPort = Number(process.env.API_PORT) || 8080; - const dev = process.env.NODE_ENV !== 'production'; - const app = next({ dev }); - const handle = app.getRequestHandler(); const server = Server({ games: [OpenStarTerVillage], @@ -26,17 +21,9 @@ async function serve() { apiCallback: () => console.log(`Lobby api running on port ${apiPort}`), }; - await app.prepare(); server.run({ ...mainServerConfig, lobbyConfig, - }, () => { - server.app.use(async (ctx, next) => { - const parsedUrl = url.parse(ctx.req.url!, true); - await handle(ctx.req, ctx.res, parsedUrl); - ctx.respond = false; - await next(); - }); }); }