Skip to content

Commit e80eb9b

Browse files
authored
Merge pull request #8 from zerodha/feat-not-found
feat: add wrapper for default not found handler
2 parents e977d12 + 9607761 commit e80eb9b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fastglue.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@ func (f *Fastglue) Any(path string, h FastRequestHandler) {
241241
f.Router.DELETE(path, f.handler(h))
242242
}
243243

244+
// NotFound is fastglue's wrapper over fasthttprouter's `router.NotFound` handler.
245+
func (f *Fastglue) NotFound(h FastRequestHandler) {
246+
f.Router.NotFound = f.handler(h)
247+
}
248+
244249
// ServeStatic serves static files under `rootPath` on `path` urls.
245250
// The `path` must end with "/{filepath:*}", files are then served from the local
246251
// path /defined/root/dir/{filepath:*}. For example `path` can be

0 commit comments

Comments
 (0)