3 ms·
Ah that is really cool, recently a user requested a feature[1] that is basically this but I solved it in a different way [undocumented]: pagex.base = '/use
by franciscop 10y ago
Ah that is really cool, recently a user requested a feature[1] that is basically this but I solved it in a different way [undocumented]:
pagex.base = '/users';
pagex('/', listUsers);
pagex('/:username', showUser);
pagex.base = '';
I am still considering extend it in this way:
pagex.namespace('/users', function(pagex){
pagex('/', listUsers);
pagex('/:username', showUser);
});
[1] https://github.com/franciscop/pagex/issues/1 https://github.com/franciscop/pagex/issues/1
- kevinsimper 10y agoWhy .namespace and not .use like express?
- franciscop 10y agoBecause it is completely unrelated to express, and even with express that is not really how it works so it'd only cause confusion