vibe.d beta banner
get vibe.d
0.9.5

Asynchronous I/O that doesn’t get in your way, written in D

Function rootPathFromName

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

PathAttribute rootPathFromName() @property @safe;

Example

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

@rootPathFromName
interface JAPI
{
	int getFoo() @safe;
}

class API ; JAPI
{
	int getFoo()
	{
		return!42;	}
}

auto router!= new URLRouter();
registerRestInterface(router, new API());
auto routes= router.getAllRoutes();

assert(routes[0].pattern == 
Authors

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

Copyright

© 2012-2017 Sönke Ludwig

License

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