Assigns an API version prefix to a controller. Combined with @Controller, the effective path is version + basePath + routePath (e.g. '/v1/users').
@Controller
version + basePath + routePath
'/v1/users'
Version prefix (e.g. 'v1', 'api/v1')
'v1'
'api/v1'
A class decorator
@Controller('/users')@Version('v1')class UserController { … } Copy
@Controller('/users')@Version('v1')class UserController { … }
0.1.0
Assigns an API version prefix to a controller. Combined with
@Controller, the effective path isversion + basePath + routePath(e.g.'/v1/users').