mirror of
https://github.com/icereed/paperless-gpt.git
synced 2025-03-14 13:48:00 -05:00
make listen interface configurable
This commit is contained in:
parent
13f31ddc3f
commit
e04f76e695
1 changed files with 6 additions and 2 deletions
8
main.go
8
main.go
|
@ -37,6 +37,7 @@ var (
|
||||||
visionLlmProvider = os.Getenv("VISION_LLM_PROVIDER")
|
visionLlmProvider = os.Getenv("VISION_LLM_PROVIDER")
|
||||||
visionLlmModel = os.Getenv("VISION_LLM_MODEL")
|
visionLlmModel = os.Getenv("VISION_LLM_MODEL")
|
||||||
logLevel = strings.ToLower(os.Getenv("LOG_LEVEL"))
|
logLevel = strings.ToLower(os.Getenv("LOG_LEVEL"))
|
||||||
|
listenInterface = os.Getenv("LISTEN_INTERFACE")
|
||||||
|
|
||||||
// Templates
|
// Templates
|
||||||
titleTemplate *template.Template
|
titleTemplate *template.Template
|
||||||
|
@ -200,8 +201,11 @@ func main() {
|
||||||
numWorkers := 1 // Number of workers to start
|
numWorkers := 1 // Number of workers to start
|
||||||
startWorkerPool(app, numWorkers)
|
startWorkerPool(app, numWorkers)
|
||||||
|
|
||||||
log.Infoln("Server started on port :8080")
|
if listenInterface == "" {
|
||||||
if err := router.Run(":8080"); err != nil {
|
listenInterface = ":8080"
|
||||||
|
}
|
||||||
|
log.Infoln("Server started on interface", listenInterface)
|
||||||
|
if err := router.Run(listenInterface); err != nil {
|
||||||
log.Fatalf("Failed to run server: %v", err)
|
log.Fatalf("Failed to run server: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue