@monocle.sh/studio 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/static.js +5 -1
- package/dist/start/routes.js +2 -0
- package/package.json +1 -1
package/dist/config/static.js
CHANGED
|
@@ -5,7 +5,11 @@ var static_default = defineConfig({
|
|
|
5
5
|
immutable: true,
|
|
6
6
|
maxAge: "1y",
|
|
7
7
|
cacheControl: true,
|
|
8
|
-
etag: true
|
|
8
|
+
etag: true,
|
|
9
|
+
headers: (path) => {
|
|
10
|
+
if (!path.endsWith(".html")) return {};
|
|
11
|
+
return { "Cache-Control": "no-cache, must-revalidate" };
|
|
12
|
+
}
|
|
9
13
|
});
|
|
10
14
|
//#endregion
|
|
11
15
|
export { static_default as default };
|
package/dist/start/routes.js
CHANGED
|
@@ -24,12 +24,14 @@ router.delete("/mcp", [() => import("../controllers/mcp_controller.js"), "handle
|
|
|
24
24
|
* Static assets (js, css, etc.) are handled by @adonisjs/static middleware.
|
|
25
25
|
*/
|
|
26
26
|
const uiDistPath = join(fileURLToPath(import.meta.url), "..", "..", "..", "ui", "dist");
|
|
27
|
+
const HTML_NO_CACHE_HEADERS = { "Cache-Control": "no-cache, must-revalidate" };
|
|
27
28
|
router.get("*", ({ request, response }) => {
|
|
28
29
|
const url = request.url();
|
|
29
30
|
if (url.startsWith("/v1/") || url.startsWith("/api/")) return response.notFound("Not found");
|
|
30
31
|
const indexPath = join(uiDistPath, "index.html");
|
|
31
32
|
if (!existsSync(indexPath)) return response.ok("<html><body style=\"background:#222;color:#fff;font-family:monospace;display:flex;align-items:center;justify-content:center;height:100vh\"><div style=\"text-align:center\"><h2>Monocle DevTools</h2><p>UI not built yet. Run: cd packages/devtools/ui && pnpm build</p></div></body></html>");
|
|
32
33
|
response.header("content-type", "text/html");
|
|
34
|
+
Object.entries(HTML_NO_CACHE_HEADERS).forEach(([key, value]) => response.header(key, value));
|
|
33
35
|
response.stream(createReadStream(indexPath));
|
|
34
36
|
});
|
|
35
37
|
//#endregion
|