diff options
author | Alan Pearce | 2023-09-11 19:43:06 +0200 |
---|---|---|
committer | Alan Pearce | 2023-09-11 19:43:06 +0200 |
commit | 51cc4389f6dc7947ee34d1b3367876941e8a8fbc (patch) | |
tree | 300ad6bc3cdfcdbbc73e7a543e0807c2da6b7785 /src | |
parent | a25028aa30bf0f3b89a9a7c99192e1a14267fc97 (diff) | |
download | homestead-51cc4389f6dc7947ee34d1b3367876941e8a8fbc.tar.lz homestead-51cc4389f6dc7947ee34d1b3367876941e8a8fbc.tar.zst homestead-51cc4389f6dc7947ee34d1b3367876941e8a8fbc.zip |
Serve static files
Diffstat (limited to 'src')
-rw-r--r-- | src/index.ts | 12 |
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" + }), }) |