Make listen port configurable
Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
@@ -15,6 +15,7 @@ type AppConfigs struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Settings struct {
|
type Settings struct {
|
||||||
|
ListenPort string `json:"listen_port"`
|
||||||
SifCdnServer string `json:"sif_cdn_server"`
|
SifCdnServer string `json:"sif_cdn_server"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,6 +35,7 @@ func DefaultConfigs() *AppConfigs {
|
|||||||
return &AppConfigs{
|
return &AppConfigs{
|
||||||
AppName: "honoka-chan",
|
AppName: "honoka-chan",
|
||||||
Settings: Settings{
|
Settings: Settings{
|
||||||
|
ListenPort: "80",
|
||||||
SifCdnServer: "http://192.168.1.123/static",
|
SifCdnServer: "http://192.168.1.123/static",
|
||||||
},
|
},
|
||||||
UserPrefs: UserPrefs{
|
UserPrefs: UserPrefs{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"honoka-chan/config"
|
||||||
"honoka-chan/db"
|
"honoka-chan/db"
|
||||||
"honoka-chan/router"
|
"honoka-chan/router"
|
||||||
_ "honoka-chan/tools"
|
_ "honoka-chan/tools"
|
||||||
@@ -33,5 +34,5 @@ func main() {
|
|||||||
// SIF
|
// SIF
|
||||||
router.SifRouter(r)
|
router.SifRouter(r)
|
||||||
|
|
||||||
r.Run(":80") // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
|
r.Run(":" + config.Conf.Settings.ListenPort) // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user