import vibe.http.router; import vibe.web.rest; @rootPathFromName interface IAPI { int getFoo() @safe; } class API : IAPI { int getFoo() { return 42; } } auto router = new URLRouter(); registerRestInterface(router, new API()); auto routes= router.getAllRoutes(); assert(routes[0].pattern == "/iapi/foo" && routes[0].method == HTTPMethod.GET);
Convenience alias to generate a name from the interface's name.