1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00

minor (see previous commit)

This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-01-07 05:36:56 +02:00
parent 240fdb6dc3
commit 541fa75caf
4 changed files with 4 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ func main() {
You can customize it by setting a version based on the request context:
api.Use(func(ctx *context.Context) {
if version := ctx.URLParam("version"); version != "" {
SetVersion(ctx, version)
versioning.SetVersion(ctx, version)
}
ctx.Next()
@@ -48,6 +48,8 @@ func main() {
// Create a new Group, which is a compatible Party,
// based on version constraints.
v1 := versioning.NewGroup(api, ">=1.0.0 <2.0.0")
// To mark an API version as deprecated use the Deprecated method.
// v1.Deprecated(versioning.DefaultDeprecationOptions)
// Optionally, set custom view engine and path
// for templates based on the version.