Sha256: 819c1f0950fdd63b7542d881cd193f34d43eef58fb40ac24316449875917eb9b
Contents?: true
Size: 715 Bytes
Versions: 15
Compression:
Stored size: 715 Bytes
Contents
package handlers import ( "net/http" "reflect" "github.com/gorilla/pat" "<%= namespace %>/<%= application_name %>/logging" ) type RouterDependenciesContainer struct { StatsD logging.StatsD `inject:"statsd"` } var RouterDependencies *RouterDependenciesContainer = &RouterDependenciesContainer{} func GetRouter() *pat.Router { r := pat.New() r.Get("/v1/health", HealthHandler) r.Add("POST", "/v1/echo", requestValidationHandler( ECHO_HANDLER+POST, reflect.TypeOf(Echo{}), RouterDependencies.StatsD, http.HandlerFunc(EchoHandler), )) //Add routing for static routes s := http.StripPrefix("/swagger/", http.FileServer(http.Dir("/swagger"))) r.PathPrefix("/swagger/").Handler(s) return r }
Version data entries
15 entries across 15 versions & 1 rubygems