diff pkg/controllers/routes.go @ 5259:680be197844d

Merged branch new-fwa.
author Sascha Wilde <wilde@intevation.de>
date Wed, 13 May 2020 11:28:34 +0200
parents 6ba7e6ac0882
children 0919946f624b
line wrap: on
line diff
--- a/pkg/controllers/routes.go	Tue May 12 16:52:08 2020 +0200
+++ b/pkg/controllers/routes.go	Wed May 13 11:28:34 2020 +0200
@@ -324,21 +324,12 @@
 
 	// Handler to serve data to the client.
 
+	api.Handle("/data/{type:availability|fairway}/{kind:stretch|section|bottleneck}/{name:.+}", any(
+		mw.DBConn(http.HandlerFunc(fairwayAvailability)))).Methods(http.MethodGet)
+
 	api.Handle("/data/stretch/shape/{name:.+}", any(
 		mw.DBConn(http.HandlerFunc(stretchShapeDownload)))).Methods(http.MethodGet)
 
-	api.Handle("/data/{kind:stretch|section}/availability/{name:.+}", any(
-		mw.DBConn(http.HandlerFunc(stretchAvailabilty)))).Methods(http.MethodGet)
-
-	api.Handle("/data/{kind:stretch|section}/fairway-depth/{name:.+}", any(
-		mw.DBConn(http.HandlerFunc(stretchAvailableFairwayDepth)))).Methods(http.MethodGet)
-
-	api.Handle("/data/bottleneck/fairway-depth/{objnam:.+}", any(
-		mw.DBConn(http.HandlerFunc(bottleneckAvailableFairwayDepth)))).Methods(http.MethodGet)
-
-	api.Handle("/data/bottleneck/availability/{objnam:.+}", any(
-		mw.DBConn(http.HandlerFunc(bottleneckAvailabilty)))).Methods(http.MethodGet)
-
 	api.Handle("/data/waterlevels/{gauge:.+}", any(
 		mw.DBConn(http.HandlerFunc(waterlevels)))).Methods(http.MethodGet)