Hi. I got time to play a bit with UDAs and vibe, and while this isn't much, I think the possibilities for more declarative code looks good.
module myapp;
mixin CurrentModule;
@(page.get("/")) void index(HTTPServerRequest req, HTTPServerResponse res) {
res.renderCompat!"index.dt"();
}
shared static this() {
auto router = new URLRouter();
router.addRoutesFromMembersOf!__CurrentModule;
}
Notice @(page.get"/")
and addRoutesFromMembersOf!__CurrentModule
.
Next up is trying to fix UDAs for the inject pattern. Hopefully I can write the following
@(page.get("/"))
@(requires!(userLoggedIn, hasRights!(addUser)))
void add_user(Params...)( // etc
Is anyone else playing around with UDAs and vibe?