mirror of
https://github.com/icereed/paperless-gpt.git
synced 2025-03-14 05:38:01 -05:00
feat: allow setting of path to load static files from
This commit is contained in:
parent
17ae37b590
commit
1d7f3349ba
1 changed files with 7 additions and 3 deletions
10
main.go
10
main.go
|
@ -38,6 +38,7 @@ var (
|
|||
visionLlmModel = os.Getenv("VISION_LLM_MODEL")
|
||||
logLevel = strings.ToLower(os.Getenv("LOG_LEVEL"))
|
||||
listenInterface = os.Getenv("LISTEN_INTERFACE")
|
||||
webuiPath = os.Getenv("WEBUI_PATH")
|
||||
|
||||
// Templates
|
||||
titleTemplate *template.Template
|
||||
|
@ -188,13 +189,16 @@ func main() {
|
|||
})
|
||||
}
|
||||
|
||||
if webuiPath == "" {
|
||||
webuiPath = "./web-app/dist"
|
||||
}
|
||||
// Serve static files for the frontend under /assets
|
||||
router.StaticFS("/assets", gin.Dir("./web-app/dist/assets", true))
|
||||
router.StaticFile("/vite.svg", "./web-app/dist/vite.svg")
|
||||
router.StaticFS("/assets", gin.Dir(webuiPath+"/assets", true))
|
||||
router.StaticFile("/vite.svg", webuiPath+"/vite.svg")
|
||||
|
||||
// Catch-all route for serving the frontend
|
||||
router.NoRoute(func(c *gin.Context) {
|
||||
c.File("./web-app/dist/index.html")
|
||||
c.File(webuiPath + "/index.html")
|
||||
})
|
||||
|
||||
// Start OCR worker pool
|
||||
|
|
Loading…
Reference in a new issue