bosia 0.1.9 → 0.1.10
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/core/html.ts +1 -1
- package/src/core/server.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bosia",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A fast, batteries-included fullstack framework — SSR · Svelte 5 Runes · Bun · ElysiaJS. File-based routing inspired by SvelteKit. No Node.js, no Vite, no adapters.",
|
|
6
6
|
"keywords": [
|
package/src/core/html.ts
CHANGED
|
@@ -216,7 +216,7 @@ export function compress(body: string, contentType: string, req: Request, status
|
|
|
216
216
|
|
|
217
217
|
// ─── Static File Detection ────────────────────────────────
|
|
218
218
|
|
|
219
|
-
const STATIC_EXTS = new Set([".ico", ".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg", ".css", ".js", ".woff", ".woff2", ".ttf"]);
|
|
219
|
+
const STATIC_EXTS = new Set([".ico", ".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg", ".css", ".js", ".woff", ".woff2", ".ttf", ".xml", ".txt"]);
|
|
220
220
|
|
|
221
221
|
export function isStaticPath(path: string): boolean {
|
|
222
222
|
if (path.startsWith("/dist/") || path.startsWith("/__bosia/")) return true;
|
package/src/core/server.ts
CHANGED
|
@@ -192,6 +192,11 @@ async function resolve(event: RequestEvent): Promise<Response> {
|
|
|
192
192
|
const dist = Bun.file(distPath);
|
|
193
193
|
if (await dist.exists()) return new Response(dist);
|
|
194
194
|
}
|
|
195
|
+
const staticPath = safePath("./dist/static", path);
|
|
196
|
+
if (staticPath) {
|
|
197
|
+
const staticFile = Bun.file(staticPath);
|
|
198
|
+
if (await staticFile.exists()) return new Response(staticFile);
|
|
199
|
+
}
|
|
195
200
|
return new Response("Not Found", { status: 404 });
|
|
196
201
|
}
|
|
197
202
|
|