mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-19 19:37:59 +02:00
Allow override of serving port by env var (#160)
Can now set HISHTORY_SERVER_PORT but will default to 8080.
This commit is contained in:
parent
eec0745fbe
commit
9ac3df1bbb
@ -211,7 +211,11 @@ func main() {
|
||||
|
||||
go runBackgroundJobs(context.Background(), srv, db, stats)
|
||||
|
||||
if err := srv.Run(context.Background(), ":8080"); err != nil {
|
||||
port := os.Getenv("HISHTORY_SERVER_PORT")
|
||||
if port == "" {
|
||||
port = "8080"
|
||||
}
|
||||
if err := srv.Run(context.Background(), ":"+port); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user