Mercurial > gemma
diff pkg/controllers/routes.go @ 2694:0d7a4fdb9e12
Added GET /api/data/waterlevels/{gauge isrs}?from={time_a}&to={time_b} to fetch waterlevels of gauge.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 15 Mar 2019 18:34:13 +0100 |
parents | c4242b9d59fe |
children | 87aed4f9b1b8 |
line wrap: on
line diff
--- a/pkg/controllers/routes.go Fri Mar 15 18:24:57 2019 +0100 +++ b/pkg/controllers/routes.go Fri Mar 15 18:34:13 2019 +0100 @@ -297,6 +297,11 @@ Handle: reviewImport, })).Methods(http.MethodPut) + // Handler to serve data to the client. + + api.Handle("/data/waterlevels/{gauge}", any( + middleware.DBConn(http.HandlerFunc(waterlevels)))).Methods(http.MethodGet) + // Token handling: Login/Logout. api.HandleFunc("/login", login). Methods(http.MethodPost)