News for hackers. Stuff that matters.
Re:Show HN: Simple express-like routing for front-end by reaktivo on Wednesday August 17, 2016 @03:18AM (#12302981)
A callback is middleware, you can

    page('/some/path', middleware, callback);
Re:Show HN: Simple express-like routing for front-end by franciscop on Wednesday August 17, 2016 @03:23AM (#12302998)
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.
Re:Show HN: Simple express-like routing for front-end by gberger on Wednesday August 17, 2016 @04:43AM (#12303215)
Uh, then you and I have very different definitions of "express-like". When I think of express I think of middleware.
Re:Show HN: Simple express-like routing for front-end by franciscop on Wednesday August 17, 2016 @11:46AM (#12305546)
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.