feat: add authentication

This commit is contained in:
2025-03-01 23:22:18 +07:00
parent b53859ae23
commit f8e65ccc0e
21 changed files with 375 additions and 27 deletions
+3 -1
View File
@@ -3,4 +3,6 @@
package ui
func ServeUI() {}
import "net/http"
func ServeUI(mux *http.ServeMux) {}
+2 -2
View File
@@ -13,11 +13,11 @@ import (
//go:embed dist
var embeddedFs embed.FS
func ServeUI() {
func ServeUI(mux *http.ServeMux) {
distFs, _ := fs.Sub(embeddedFs, "dist")
fileServer := http.FileServer(http.FS(distFs))
http.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
mux.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
_path := path.Clean(r.URL.Path)[1:]
// Rewrite non-existing paths to index.html