Skip to content

Commit

Permalink
Merge pull request #8 from zerodha/feat-not-found
Browse files Browse the repository at this point in the history
feat: add wrapper for default not found handler
  • Loading branch information
knadh authored Jan 24, 2024
2 parents e977d12 + 9607761 commit e80eb9b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fastglue.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ func (f *Fastglue) Any(path string, h FastRequestHandler) {
f.Router.DELETE(path, f.handler(h))
}

// NotFound is fastglue's wrapper over fasthttprouter's `router.NotFound` handler.
func (f *Fastglue) NotFound(h FastRequestHandler) {
f.Router.NotFound = f.handler(h)
}

// ServeStatic serves static files under `rootPath` on `path` urls.
// The `path` must end with "/{filepath:*}", files are then served from the local
// path /defined/root/dir/{filepath:*}. For example `path` can be
Expand Down

0 comments on commit e80eb9b

Please sign in to comment.