mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Separate UI (#1299)
* Add custom_ui_location to serve UI from filesystem
This commit is contained in:
@@ -234,9 +234,21 @@ func Start() {
|
||||
})
|
||||
}
|
||||
|
||||
customUILocation := c.GetCustomUILocation()
|
||||
|
||||
// Serve the web app
|
||||
r.HandleFunc("/*", func(w http.ResponseWriter, r *http.Request) {
|
||||
ext := path.Ext(r.URL.Path)
|
||||
|
||||
if customUILocation != "" {
|
||||
if r.URL.Path == "index.html" || ext == "" {
|
||||
r.URL.Path = "/"
|
||||
}
|
||||
|
||||
http.FileServer(http.Dir(customUILocation)).ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
if ext == ".html" || ext == "" {
|
||||
data, _ := uiBox.Find("index.html")
|
||||
_, _ = w.Write(data)
|
||||
|
||||
Reference in New Issue
Block a user