Added dummy auth example

This commit is contained in:
sm
2018-01-24 21:52:33 -08:00
parent f61632af7f
commit bea25aa0d1
4 changed files with 52 additions and 3 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ func main() {
hs := hwt.NewMetricsHooks(metrics.HTTPLatency)
th := pb.NewHelloWorldServer(s, hs)
sm := http.NewServeMux()
sm.Handle("/", th)
sm.HandleFunc("/", hwt.Auth(th.ServeHTTP))
sm.Handle("/metrics", promhttp.Handler())
if err := http.ListenAndServe(":8080", sm); err != nil {
log.Fatalf("listen and serve: %v", err)