mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +00:00
✨ Restore back node based http server for e2e tests
This commit is contained in:
parent
ea25c5db99
commit
7a842ce36a
@ -85,7 +85,7 @@ export default defineConfig({
|
|||||||
/* Run your local dev server before starting the tests */
|
/* Run your local dev server before starting the tests */
|
||||||
webServer: {
|
webServer: {
|
||||||
timeout: 2 * 60 * 1000,
|
timeout: 2 * 60 * 1000,
|
||||||
command: "caddy file-server --root resources/public/ --listen :3000",
|
command: "node ./scripts/e2e-server.js",
|
||||||
url: "http://localhost:3000",
|
url: "http://localhost:3000",
|
||||||
reuseExistingServer: !process.env.CI,
|
reuseExistingServer: !process.env.CI,
|
||||||
},
|
},
|
||||||
|
|||||||
20
frontend/scripts/e2e-server.js
Normal file
20
frontend/scripts/e2e-server.js
Normal file
@ -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}`);
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user