about summary refs log tree commit diff stats
path: root/src/index.ts
blob: d8c9bf1de4f5a2322b2db76461b45472dfe045af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import path from "node:path";
import { withHtmlLiveReload } from "bun-html-live-reload";
import serveStatic from "serve-static-bun";

import readConfig from "./config";

const base = Bun.argv.length > 2 ? Bun.argv[Bun.argv.length - 1] : ".";

const config = readConfig(base);

export default withHtmlLiveReload({
  fetch: serveStatic(path.join(base, "public"), {
    headers: config.extra.headers,
    dotfiles: "allow",
  }),
});