diff options
| author | Felix Hanley <felix@userspace.com.au> | 2020-02-12 03:35:11 +0000 |
|---|---|---|
| committer | Felix Hanley <felix@userspace.com.au> | 2020-02-12 03:35:11 +0000 |
| commit | 9f2840abba291f00b2b0df994e57b536f690ca6e (patch) | |
| tree | 78892110aaf640ed8f8d5ab435a6cc289a0cd386 /cmd/server/main.go | |
| parent | 03a0d72fb7f79bb3a1b87551f71c299f0624a246 (diff) | |
| download | sws-9f2840abba291f00b2b0df994e57b536f690ca6e.tar.gz sws-9f2840abba291f00b2b0df994e57b536f690ca6e.tar.bz2 | |
Manually build time buckets for hits
Diffstat (limited to 'cmd/server/main.go')
| -rw-r--r-- | cmd/server/main.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go index 4b45d80..0659c2e 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -103,7 +103,7 @@ func main() { r.Route("/{domainID}", func(r chi.Router) { r.Use(domainCtx) r.Get("/", handleDomain(st)) - r.Get("/chart", handleChart(st)) + r.Get("/chart", svgChartHandler(st)) }) }) r.Get("/", handleIndex()) @@ -133,6 +133,15 @@ func getDomainCtx(db sws.DomainStore) func(http.Handler) http.Handler { } } +// func getAuthCtx(db sws.UserStore) func(http.Handler) http.Handler { +// return func(next http.Handler) http.Handler { +// return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { +// ctx := context.WithValue(r.Context(), "user", user) +// next.ServeHTTP(w, r.WithContext(ctx)) +// }) +// } +// } + func migrateDatabase(driver, dsn string) (int64, error) { db, err := sql.Open(driver, dsn) if err != nil { |
