The types for Express look a little different - params (path parameters like “pathparameter” above) are exposed as req.param and the query is exposed as req.query instead of living inside the params parameter.
I thought this would work in Meteor 3, but it doesn’t (“express.route is not a function”). What am I misunderstanding?
In Meteor 3 you are looking for the handler function and instead of route you put in the method, so it should be like this (still need to test this, I’m currently blocked by something else in my Meteor 3 upgrade):
Turns out my code was already sort of working, but there is one gotcha that migrators should be aware of:
Picker.useMiddleware registers middleware that will be run before any routing takes place regardless of whether a route was registered before the middleware.
Express will run middleware precisely depending on the order of registration.
When you instead use .use() from the Express APIs, the order of registration becomes important. If you register a route BEFORE you register middleware on the same express entity (application or router), the middleware will run AFTER the route handler.