browsertrix/frontend/scripts/serve.js
Emma Segal-Grossman b1e2f1b325
Add ESLint rules for import ordering (#1608)
Follow-up from
https://github.com/webrecorder/browsertrix-cloud/pull/1546#discussion_r1529001599
(cc @SuaYoo)

- Adds `eslint-plugin-import-x` and
`@ianvs/prettier-plugin-sort-imports` and configures rules for them both
so imports get sorted on format & on lint.
- Runs both on everything!
2024-03-18 21:50:02 -04:00

19 lines
604 B
JavaScript

// Serve app locally without building with webpack, e.g. for e2e
const connectHistoryApiFallback = require("connect-history-api-fallback");
const express = require("express");
const { createProxyMiddleware } = require("http-proxy-middleware");
const devServerConfig = require("../config/dev-server.js");
const app = express();
devServerConfig.onBeforeSetupMiddleware({ app });
app.use("/", express.static("dist"));
Object.keys(devServerConfig.proxy).forEach((path) => {
app.use(path, createProxyMiddleware(devServerConfig.proxy[path]));
});
app.use(connectHistoryApiFallback());
app.listen(9871);