@riligar/elysia-sqlite 1.1.6 → 1.1.7
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/package.json +1 -1
- package/src/index.js +10 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -28,6 +28,7 @@ const mimeTypes = {
|
|
|
28
28
|
export const sqliteAdmin = ({ dbPath, prefix = "/admin", configPath = "./sqlite-admin-config.json" }) => {
|
|
29
29
|
const db = new Database(dbPath);
|
|
30
30
|
const uiPath = join(import.meta.dir, "ui", "dist");
|
|
31
|
+
console.log("[SQLite Admin] UI Path:", uiPath);
|
|
31
32
|
|
|
32
33
|
// Gerenciador de Sessão
|
|
33
34
|
const sessionManager = createSessionManager();
|
|
@@ -238,7 +239,14 @@ export const sqliteAdmin = ({ dbPath, prefix = "/admin", configPath = "./sqlite-
|
|
|
238
239
|
// Servir index.html na raiz
|
|
239
240
|
.get("/", async () => {
|
|
240
241
|
const file = Bun.file(join(uiPath, "index.html"));
|
|
241
|
-
return new Response(file, {
|
|
242
|
+
return new Response(file, {
|
|
243
|
+
headers: {
|
|
244
|
+
"Content-Type": "text/html",
|
|
245
|
+
"Cache-Control": "no-cache, no-store, must-revalidate",
|
|
246
|
+
"Pragma": "no-cache",
|
|
247
|
+
"Expires": "0"
|
|
248
|
+
}
|
|
249
|
+
});
|
|
242
250
|
})
|
|
243
251
|
|
|
244
252
|
// Servir arquivos estáticos da pasta assets
|
|
@@ -256,6 +264,7 @@ export const sqliteAdmin = ({ dbPath, prefix = "/admin", configPath = "./sqlite-
|
|
|
256
264
|
return new Response(file, {
|
|
257
265
|
headers: {
|
|
258
266
|
"Content-Type": mimeTypes[ext] || "application/octet-stream",
|
|
267
|
+
"Cache-Control": "public, max-age=31536000, immutable"
|
|
259
268
|
},
|
|
260
269
|
});
|
|
261
270
|
})
|