~netlandish/gobwebs

946744a654ed5b9e3d905400f5e7f6cced8759d0 — Peter Sanchez 2 years ago 9f3b958
Adding StaticURL to config
1 files changed, 8 insertions(+), 2 deletions(-)

M config/config.go
M config/config.go => config/config.go +8 -2
@@ 22,7 22,9 @@ type Config struct {

	EmailSvc   string
	StorageSvc string
	MediaURL   string

	StaticURL string
	MediaURL  string

	AdminEmail       string
	EmailAdminErrors bool


@@ 56,7 58,8 @@ func LoadConfig(fname string) (*Config, error) {
		Timeout:          30,
		EmailSvc:         "console",
		StorageSvc:       "fs",
		MediaURL:         "/static/",
		StaticURL:        "/static",
		MediaURL:         "/media",
		AdminEmail:       "admin@localhost",
		EmailAdminErrors: true,
		DefaultFromEmail: "gobwebs@localhost",


@@ 111,6 114,9 @@ func LoadConfig(fname string) (*Config, error) {
		}
	}

	if val, ok := file.Get("gobwebs", "static-url"); ok {
		conf.StaticURL = val
	}
	if val, ok := file.Get("gobwebs", "media-url"); ok {
		conf.MediaURL = val
	}