Function rootPath
UDA to define root URL prefix for annotated REST interface.
Empty path
means deducing prefix from interface type name (see also rootPathFromName
)
Prototype
vibe.web.common.RootPath rootPath( string path );
Example
import vibe.http.router; import vibe.web.rest; @rootPath("/oops") interface IAPI { int getFoo(); } class API : IAPI { int getFoo() { return 42; } } auto router = new URLRouter(); registerRestInterface(router, new API()); auto routes= router.getAllRoutes(); assert(routes[HTTPMethod.GET][0].pattern == "/oops/foo");
Authors
Sönke Ludwig, Михаил Страшун
Copyright
© 2012-2013 RejectedSoftware e.K.
License
Subject to the terms of the MIT license, as written in the included LICENSE.txt file.