Mercurial > gemma
comparison pkg/controllers/routes.go @ 2147:b66cfcde8ff7
Print templates: Stubbed endpoints under /api/templates/print/{name}
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 08 Feb 2019 11:02:05 +0100 |
parents | e6dccc7a3ea1 |
children | 51c5aead78c0 |
comparison
equal
deleted
inserted
replaced
2146:7267f8168176 | 2147:b66cfcde8ff7 |
---|---|
93 api.Handle("/users/passwordreset/{hash}", &JSONHandler{ | 93 api.Handle("/users/passwordreset/{hash}", &JSONHandler{ |
94 Handle: passwordReset, | 94 Handle: passwordReset, |
95 NoConn: true, | 95 NoConn: true, |
96 }).Methods(http.MethodGet) | 96 }).Methods(http.MethodGet) |
97 | 97 |
98 // Print templates | |
99 api.Handle("/templates/print", any(&JSONHandler{ | |
100 Handle: listPrintTemplates, | |
101 })).Methods(http.MethodGet) | |
102 | |
103 api.Handle("/templates/print/{name}", any(&JSONHandler{ | |
104 Handle: fetchPrintTemplate, | |
105 })).Methods(http.MethodGet) | |
106 | |
107 api.Handle("/templates/print/{name}", waterwayAdmin(&JSONHandler{ | |
108 Handle: createPrintTemplate, | |
109 })).Methods(http.MethodPost) | |
110 | |
111 api.Handle("/templates/print/{name}", waterwayAdmin(&JSONHandler{ | |
112 Handle: deletePrintTemplate, | |
113 })).Methods(http.MethodDelete) | |
114 | |
115 api.Handle("/templates/print/{name}", waterwayAdmin(&JSONHandler{ | |
116 Handle: updatePrintTemplate, | |
117 })).Methods(http.MethodPatch) | |
118 | |
98 // External proxies. | 119 // External proxies. |
99 external := middleware.NotFound(&httputil.ReverseProxy{ | 120 external := middleware.NotFound(&httputil.ReverseProxy{ |
100 Director: proxyDirector(models.ExternalServices.Find), | 121 Director: proxyDirector(models.ExternalServices.Find), |
101 ModifyResponse: proxyModifyResponse("/api/external/"), | 122 ModifyResponse: proxyModifyResponse("/api/external/"), |
102 }) | 123 }) |