commit e2a6bf9f94bc55594d7fc4b91a651025aa81046e
parent e5a60b05c92f1d7e69944f7a03dd1b743deb49dd
Author: weetat <wtenison@protonmail.com>
Date: Wed, 12 Feb 2025 22:09:22 +0000
Serve /web/ from WebDir instead of a hardcoded path
The file server was pointed at /home/miki/. Also link styles.css from
index.html and drop the placeholder heading.
Diffstat:
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/miki/miki.go b/src/miki/miki.go
@@ -143,7 +143,7 @@ func main() {
/// SET UP SERVER MUX ///
_mux := http.NewServeMux()
- _mux.Handle("/web/", http.StripPrefix("/web/", http.FileServer(http.Dir("/home/miki/"))))
+ _mux.Handle("/web/", http.StripPrefix("/web/", http.FileServer(http.Dir(_fs.FileSystemInfo.WebDir))))
_mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
_r, _err := MakeResourceSig(_fs.FileSystemInfo.WebDir+"/", -1, regexp.MustCompile("^([a-zA-Z0-9.]+).html$"))
diff --git a/web/index.html b/web/index.html
@@ -3,9 +3,10 @@
<head>
<title>Miki</title>
<meta name="viewport" charset="utf-8" content="width=device-width, initial-scale=1.0"/>
+ <link rel="stylesheet" type="text/css" href="/web/styles.css"/>
</head>
<body>
- <h1>HELLO WORLD</h1>
+
</body>
</html>
\ No newline at end of file