Hacker News new | ask | show | jobs
by reaktivo 3595 days ago
A callback is middleware, you can

    page('/some/path', middleware, callback);
1 comments

I see, but I don't really like this extra functionality for pagex. I am not looking to copy express with middleware for front-end, just wanted some easy and straight way to load a script if we are in the correct part of the website.
Uh, then you and I have very different definitions of "express-like". When I think of express I think of middleware.
In the simple way, express accepts a path (url-like fragment) and executes a callback when it matches the url. THAT is what I meant from express-like, but from this and other comments I can see it wasn't clear at all.