api-version
Axum middleware to rewrite a request such that a version prefix is added to the path. This is based on a set of API versions and an optional "x-api-version"
custom HTTP header: if no such header is present, the highest version is used. Yet this only applies to requests the URIs of which pass a filter; others are not rewritten. Also, paths starting with a valid/existing version prefix, e.g. "/v0"
, are not rewritten.
Example
;
let app = new
.route
.route
.route;
const API_VERSIONS: = new;
let app = new.layer;
License
This code is open source software licensed under the Apache 2.0 License.