about summary refs log tree commit diff stats
path: root/src/index.ts
diff options
context:
space:
mode:
authorAlan Pearce2023-09-11 19:43:06 +0200
committerAlan Pearce2023-09-11 19:43:06 +0200
commit51cc4389f6dc7947ee34d1b3367876941e8a8fbc (patch)
tree300ad6bc3cdfcdbbc73e7a543e0807c2da6b7785 /src/index.ts
parenta25028aa30bf0f3b89a9a7c99192e1a14267fc97 (diff)
downloadwebsite-51cc4389f6dc7947ee34d1b3367876941e8a8fbc.tar.lz
website-51cc4389f6dc7947ee34d1b3367876941e8a8fbc.tar.zst
website-51cc4389f6dc7947ee34d1b3367876941e8a8fbc.zip
Serve static files
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/index.ts b/src/index.ts
index 8c0a3ba..59913b3 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,10 +1,10 @@
-import { withHtmlLiveReload } from "bun-html-live-reload";
-import Siopao from "siopao";
+import { withHtmlLiveReload } from "bun-html-live-reload"
+import serveStatic from "serve-static-bun"
 
-const router = new Siopao();
-
-router.get("/status", () => new Response("OK"));
+const dir = Bun.argv.length > 2 ? Bun.argv[Bun.argv.length - 1] : "./"
 
 export default withHtmlLiveReload({
-  fetch: router.fetch.bind(router),
+  fetch: serveStatic(dir, {
+    dotfiles: "allow"
+  }),
 })