class
Amber::Pipe::ApiVersion
- Amber::Pipe::ApiVersion
- Amber::Pipe::Base
- Reference
- Object
Overview
Middleware that extracts an API version from request headers and normalizes it into a standard internal header for downstream use.
Usage in pipeline configuration: Amber::Server.instance.pipeline :api do plug Amber::Pipe::ApiVersion.new(default_version: "v1") end
Controllers can then access the version: request.headers["X-Api-Version"]?
Defined in:
amber/pipes/api_version.crConstructors
Instance Method Summary
-
#call(context : HTTP::Server::Context)
Execution of this handler.
Instance methods inherited from class Amber::Pipe::Base
call(context : HTTP::Server::Context)
call
Constructor Detail
Instance Method Detail
def call(context : HTTP::Server::Context)
#
Description copied from class Amber::Pipe::Base
Execution of this handler.