How can I access express.json() and express.urlencoded() in WebApp?
As far as I can see the WebApp.handlers export is an express router to prevent users messing with the internals.
However when sending post requests that are 'Content-Type': 'application/x-www-form-urlencoded' then the req.body is empty. Using body-parser is deprecated for express >=4.16.
This is importing the WebApp from the meteor/webapp package and then destructuring express from WebApp. This express is the Express module that has been integrated into the WebApp package as of Meteor v3, as mentioned in the migration docs.
This is accessing the Express module directly from the WebAppInternals.NpmModules object. This is not the recommended way to access Express in Meteor v3 and later, as the WebApp package now provides a more direct and integrated way to use Express.
If the chatbot answer is correct, the Meteor 3 Docs team deserves added praise!
Tested the first option it works. I think in the past (at some point in the beta or rc) it did not work for me, so that is why I had the other approach.