mirror of
https://github.com/khairul169/garage-webui.git
synced 2026-09-15 00:43:21 +07:00
feat: add authentication
This commit is contained in:
+3
-1
@@ -3,4 +3,6 @@
|
||||
|
||||
package ui
|
||||
|
||||
func ServeUI() {}
|
||||
import "net/http"
|
||||
|
||||
func ServeUI(mux *http.ServeMux) {}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user