17 lines
482 B
TypeScript
17 lines
482 B
TypeScript
import { http, HttpResponse } from "msw";
|
|
|
|
export function createBootstrapHandlers(
|
|
runtimeConfig: Readonly<Record<string, unknown>>,
|
|
releaseManifest: Readonly<Record<string, unknown>>,
|
|
baseUrl = "http://app.test",
|
|
) {
|
|
return [
|
|
http.get(`${baseUrl}/config.json`, () =>
|
|
HttpResponse.json(structuredClone(runtimeConfig)),
|
|
),
|
|
http.get(`${baseUrl}/release-manifest.json`, () =>
|
|
HttpResponse.json(structuredClone(releaseManifest)),
|
|
),
|
|
] as const;
|
|
}
|