Add visual parity screenshot diff tool and mock appSettings in dev server
Add pixelmatch-based screenshot comparison script that captures Angular (:4200) and React (:8080) at every route and generates pixel diff images. Dev server: add mock /api/appSettings endpoint so Angular can bootstrap when WAF blocks the real API.
This commit is contained in:
@@ -40,6 +40,24 @@ await new Promise((r) => setTimeout(r, 18000));
|
||||
|
||||
const app = express();
|
||||
|
||||
// --- Mock fallback for /api/appSettings when WAF blocks requests ---
|
||||
app.get("/api/appSettings", (req, res) => {
|
||||
res.json({
|
||||
showDebugVersion: "False",
|
||||
uiOptions: {
|
||||
isTestVersion: "",
|
||||
filter: {
|
||||
schedule: { searchFrom: "30d", searchTo: "30d", timeStep: "" },
|
||||
onlineboard: { searchFrom: "2d", searchTo: "14d", timeStep: "" },
|
||||
},
|
||||
buttons: {
|
||||
buyTicket: { period: { min: "2h", max: "72h" } },
|
||||
flightStatus: { availableFrom: "24h", visible: "" },
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// --- API proxy via curl (bypasses WAF TLS fingerprinting) ---
|
||||
app.use(["/api", "/flights"], (req, res) => {
|
||||
const targetUrl = `${API_TARGET}${req.originalUrl}`;
|
||||
|
||||
Reference in New Issue
Block a user