Ensure properly configured BaseUrl.
This commit is contained in:
parent
71a46ba5a1
commit
e14116c99f
|
@ -1,7 +1,9 @@
|
||||||
package config
|
package config
|
||||||
|
|
||||||
var Config = HMNConfig{
|
var Config = HMNConfig{
|
||||||
Env: Dev,
|
Env: Dev,
|
||||||
|
Addr: ":9001",
|
||||||
|
BaseUrl: "http://handmade.local:9001",
|
||||||
Postgres: PostgresConfig{
|
Postgres: PostgresConfig{
|
||||||
User: "hmn",
|
User: "hmn",
|
||||||
Password: "password",
|
Password: "password",
|
||||||
|
|
|
@ -22,6 +22,9 @@ func init() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(oops.New(err, "could not parse base URL"))
|
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
|
baseUrlParsed = *parsed
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue