Skip to content

Commit

Permalink
Always serve static.goatcounter.com
Browse files Browse the repository at this point in the history
  • Loading branch information
arp242 committed Dec 3, 2019
1 parent 5b787c9 commit 16af9c8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/goatcounter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ func main() {
d := zhttp.RemovePort(cfg.Domain)
ds := zhttp.RemovePort(cfg.DomainStatic)
zhttp.Serve(&http.Server{Addr: cfg.Listen, Handler: zhttp.HostRoute(map[string]chi.Router{
d: zhttp.RedirectHost("//www." + cfg.Domain),
"www." + d: handlers.NewWebsite(db),
ds: handlers.NewStatic("./public", cfg.Domain, cfg.Prod),
"*": handlers.NewBackend(db),
d: zhttp.RedirectHost("//www." + cfg.Domain),
"www." + d: handlers.NewWebsite(db),
ds: handlers.NewStatic("./public", cfg.Domain, cfg.Prod),
"static.goatcounter.com": handlers.NewStatic("./public", cfg.Domain, cfg.Prod),
"*": handlers.NewBackend(db),
})}, func() {
cron.Wait(db)
acme.Wait()
Expand Down

0 comments on commit 16af9c8

Please sign in to comment.