Hello !
I have some functions that are annotated with @path and I'm getting:
--------------- http://127.0.0.1:8088/customer/delete/id/55
404 - Not Found
Not Found
Internal error information:
Not routes match path '/customer/delete/id/55'
How can I debug it ?
I added this to web.d:
void registerWebInterface(C : Object, MethodStyle method_style = MethodStyle.lowerUnderscored)(URLRouter router, C instance, WebInterfaceSettings settings = null)
{
import std.array : endsWith;
import std.traits;
if (!settings) settings = new WebInterfaceSettings;
foreach (M; __traits(allMembers, C)) {
/*static if (isInstanceOf!(SessionVar, __traits(getMember, instance, M))) {
__traits(getMember, instance, M).m_getContext = toDelegate({ return s_requestContext; });
}*/
static if (!is(typeof(__traits(getMember, Object, M)))) { // exclude Object's default methods and field
foreach (overload; MemberFunctionsTuple!(C, M)) {
alias RT = ReturnType!overload;
enum minfo = extractHTTPMethodAndName!overload();
enum url = minfo.hadPathUDA ? minfo.url : adjustMethodStyle(minfo.url, method_style);
version(debug_router) { ///////////to help debug
import vibe.core.log;
logInfo("registerWebInterface: %s", url);
} //////////////////<<<<<<<
static if (is(RT == class) || is(RT == interface)) {
The I get this output at compile time:
registerWebInterface: /
registerWebInterface: /list/:entity
registerWebInterface: user
registerWebInterface: /user/:userid
registerWebInterface: /user/:email/email
registerWebInterface: /user/:userid/delete
registerWebInterface: /user/:email/email/delete
registerWebInterface: /user/delete/:fieldname/:fieldvalue
registerWebInterface: /user/:fieldname/:fieldvalue
registerWebInterface: /customer/list/:limit
registerWebInterface: /customer/delete/:fieldname/:fieldvalue
registerWebInterface: customer
registerWebInterface: customer
registerWebInterface: /customer/:fieldname/:fieldvalue
Any clue on how to debug it ?