class

Kemal::PathHandler

Inherits HTTP::Handler < Reference < Object

PathHandler wraps a HTTP::Handler to only execute for specific path prefixes.

Example

use "/api", AuthHandler.new

The handler will only execute for requests matching the path prefix:

  • /api matches /api, /api/users, /api/posts/1
  • /api does NOT match /, /apiv2, /other

Constructors

new(path_prefix : String, handler : HTTP::Handler)
Source

Instance methods

handler
Source
path_prefix
Source