From 7a842ce36a4329e50bdbc68aeb80abccb4ced77b Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 26 Jan 2026 18:16:59 +0100 Subject: [PATCH] :sparkles: Restore back node based http server for e2e tests --- frontend/playwright.config.js | 2 +- frontend/scripts/e2e-server.js | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 frontend/scripts/e2e-server.js diff --git a/frontend/playwright.config.js b/frontend/playwright.config.js index 2e5b06560a..9af2a1eb2d 100644 --- a/frontend/playwright.config.js +++ b/frontend/playwright.config.js @@ -85,7 +85,7 @@ export default defineConfig({ /* Run your local dev server before starting the tests */ webServer: { timeout: 2 * 60 * 1000, - command: "caddy file-server --root resources/public/ --listen :3000", + command: "node ./scripts/e2e-server.js", url: "http://localhost:3000", reuseExistingServer: !process.env.CI, }, diff --git a/frontend/scripts/e2e-server.js b/frontend/scripts/e2e-server.js new file mode 100644 index 0000000000..77be5fccac --- /dev/null +++ b/frontend/scripts/e2e-server.js @@ -0,0 +1,20 @@ +import express from "express"; +import compression from "compression"; + +import { fileURLToPath } from "url"; +import path from "path"; + +const app = express(); +const port = 3000; + +app.use(compression()); + +const staticPath = path.join( + fileURLToPath(import.meta.url), + "../../resources/public", +); +app.use(express.static(staticPath)); + +app.listen(port, () => { + console.log(`Listening at 0.0.0.0:${port}`); +});