about summary refs log tree commit diff stats
path: root/src/index.ts
diff options
context:
space:
mode:
authorAlan Pearce2023-09-12 10:56:39 +0200
committerAlan Pearce2023-09-12 10:56:39 +0200
commit78439b16cc66532225e75c9aa40cf7c49cddc22d (patch)
tree24514d56345534ad50ad6180026d67b605fea071 /src/index.ts
parentb45b4e37af14d94726b0c5d2691289886c0527cf (diff)
downloadhomestead-78439b16cc66532225e75c9aa40cf7c49cddc22d.tar.lz
homestead-78439b16cc66532225e75c9aa40cf7c49cddc22d.tar.zst
homestead-78439b16cc66532225e75c9aa40cf7c49cddc22d.zip
Read config from TOML file
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/index.ts b/src/index.ts
index 4887dd6..d8c9bf1 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,10 +1,16 @@
+import path from "node:path";
 import { withHtmlLiveReload } from "bun-html-live-reload";
 import serveStatic from "serve-static-bun";
 
-const dir = Bun.argv.length > 2 ? Bun.argv[Bun.argv.length - 1] : "./";
+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(dir, {
+  fetch: serveStatic(path.join(base, "public"), {
+    headers: config.extra.headers,
     dotfiles: "allow",
   }),
 });