vibe.d beta banner
get vibe.d
0.7.30

Function rootPathFromName

Convenience alias to generate a name from the interface's name.

Prototype

vibe.web.common.PathAttribute rootPathFromName() @property;

Example

import vibe.http.router;
import vibe.web.rest;

@rootPathFromName
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[0].pattern == "/iapi/foo" && routes[0].method == HTTPMethod.GET);
Authors

Sönke Ludwig, Михаил Страшун

Copyright

© 2012-2014 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.