Hello, I have a code in app.js , which looks like this: - App instead of app. And the module looks like this: Is this a bad practice? The "mount" path has been snoozed and is not visible to the middleware function. The main effect of this feature is that the mounted middleware code can work without regard to its "prefix" pathname without changes. The functionality can be virtually the same, but an implicit meaning means the only way through the Modify intermediate Is a good example. It can actually be one or the other, but injected into the middle of the other app object as the middleware.
app Uses ('/ someurl', Required ('. / Middleware / somemodule'));
if (process.env.BLALAL == = Undefined) {Throw "error: process.env.BLALAL === undefined"; } Module.exports = function (req, res, next) {...}
As told on:
app. ) Methods provide routing functionality in Express, where VERB is one of HTTP verbs, such as
app.post () .
IMO
app.overb API Should be set, while any middleware should be set through the
app.use API.
request or
feedback objects , or Inject the functionality of other modules which can answer
request , or not.
No comments:
Post a Comment