Ensure properly configured BaseUrl.
This commit is contained in:
parent
71a46ba5a1
commit
e14116c99f
|
@ -2,6 +2,8 @@ package config
|
|||
|
||||
var Config = HMNConfig{
|
||||
Env: Dev,
|
||||
Addr: ":9001",
|
||||
BaseUrl: "http://handmade.local:9001",
|
||||
Postgres: PostgresConfig{
|
||||
User: "hmn",
|
||||
Password: "password",
|
||||
|
|
|
@ -22,6 +22,9 @@ func init() {
|
|||
if err != nil {
|
||||
panic(oops.New(err, "could not parse base URL"))
|
||||
}
|
||||
if parsed.Scheme == "" || parsed.Host == "" {
|
||||
panic(oops.New(nil, "Website is misconfigured. Config should include a full BaseUrl (e.g. \"http://handmade.local:9001\")"))
|
||||
}
|
||||
|
||||
baseUrlParsed = *parsed
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue