Skip to content

Commit

Permalink
✨ Swap http-server for a custom server with express (front-end integr…
Browse files Browse the repository at this point in the history
…ation tests)
  • Loading branch information
belen-albeza committed Apr 25, 2024
1 parent 4780442 commit 306a8ed
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 251 deletions.
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"translations:find-unused": "node ./scripts/find-unused-translations.js",
"compile": "node ./scripts/compile.js",
"watch": "node ./scripts/watch.js",
"e2e:server": "NODE_NO_WARNINGS=1 http-server ./resources/public -p 3500 -a 0.0.0.0",
"e2e:server": "node ./scripts/e2e-server.js",
"e2e:test": "playwright test",
"storybook:compile": "gulp template:storybook && clojure -M:dev:shadow-cljs compile storybook",
"storybook:watch": "npm run storybook:compile && concurrently \"clojure -M:dev:shadow-cljs watch storybook\" \"storybook dev -p 6006\"",
Expand All @@ -51,6 +51,7 @@
"autoprefixer": "^10.4.17",
"concurrently": "^8.2.2",
"draft-js": "git+https://github.com/penpot/draft-js.git",
"express": "^4.19.2",
"fancy-log": "^2.0.0",
"gettext-parser": "^8.0.0",
"gulp": "4.0.2",
Expand All @@ -62,7 +63,6 @@
"gulp-sass": "^5.1.0",
"gulp-sourcemaps": "^3.0.0",
"gulp-svg-sprite": "^2.0.3",
"http-server": "^14.1.1",
"jsdom": "^24.0.0",
"map-stream": "0.0.7",
"marked": "^12.0.0",
Expand Down
13 changes: 13 additions & 0 deletions frontend/scripts/e2e-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import express from "express";
import { fileURLToPath } from "url";
import path from "path";

const app = express();
const port = 3500;

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}`);
});

0 comments on commit 306a8ed

Please sign in to comment.