Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba80c79 commit e530ab2Copy full SHA for e530ab2
coderd/coderd.go
@@ -69,6 +69,7 @@ func New(options *Options) (http.Handler, func()) {
69
})
70
71
r := chi.NewRouter()
72
+
73
r.Use(
74
func(next http.Handler) http.Handler {
75
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -80,6 +81,12 @@ func New(options *Options) (http.Handler, func()) {
80
81
)
82
83
r.Route("/api/v2", func(r chi.Router) {
84
+ r.NotFound(func(rw http.ResponseWriter, r *http.Request) {
85
+ httpapi.Write(rw, http.StatusNotFound, httpapi.Response{
86
+ Message: "Route not found.",
87
+ })
88
89
90
91
// Specific routes can specify smaller limits.
92
httpmw.RateLimitPerMinute(options.APIRateLimit),
0 commit comments