summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2024-02-14 00:23:35 +0100
committerRené 'Necoro' Neumann <necoro@necoro.eu>2024-02-14 00:23:35 +0100
commitce7c563f464c5d85ddafa94ce631afaa7467a4c2 (patch)
treee283e257a9b47ed9ec235916a86fc28ec808bda9
parent24c2071fcaa8065d450dae78a80a671697f0e873 (diff)
downloadgosten-ce7c563f464c5d85ddafa94ce631afaa7467a4c2.tar.gz
gosten-ce7c563f464c5d85ddafa94ce631afaa7467a4c2.tar.bz2
gosten-ce7c563f464c5d85ddafa94ce631afaa7467a4c2.zip
Handle static stuff
-rw-r--r--main.go1
-rw-r--r--static/style.css0
-rw-r--r--templ/base.tpl4
3 files changed, 3 insertions, 2 deletions
diff --git a/main.go b/main.go
index 66fa34d..896da78 100644
--- a/main.go
+++ b/main.go
@@ -50,6 +50,7 @@ func main() {
mux.Handle("GET /login", loginPage())
mux.HandleFunc("POST /login", handleLogin)
mux.Handle("GET /logout", handleLogout())
+ mux.Handle("/static/", http.StripPrefix("/static", http.FileServer(http.Dir("static"))))
mux.Handle("/favicon.ico", http.NotFoundHandler())
handler := sessionHandler(mux)
diff --git a/static/style.css b/static/style.css
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/static/style.css
diff --git a/templ/base.tpl b/templ/base.tpl
index e88d735..89e095f 100644
--- a/templ/base.tpl
+++ b/templ/base.tpl
@@ -3,14 +3,14 @@
<head>
<meta charset="UTF-8">
<title>{{block "title" .}}Kosten{{end}}</title>
- <link rel="stylesheet" href="./style.css">
+ <link rel="stylesheet" href="/static/style.css">
</head>
<body>
{{block "body" .}}
Dummy Text
{{end}}
{{block "js" .}}
- <script src="./index.js"></script>
+ <script src="/static/index.js"></script>
{{end}}
</body>
</html> \ No newline at end of file