Thursday, 16 May 2019

app.use and app.post sequence confusion

I am new. I have spent several hours trying to understand the following:If I have​thing = require('thing')​app.post('/', (req,res) => {/*using a required thing*/});​Would app.use(thing()) have to be above or bellow app.post? When it's bellow it doesn't seem to work, and when it's above it keeps my browser window in a loading loop. I am trying to do this with express.urlencoded / body-parser (both give the same result).Thanks

Submitted May 16, 2019 at 08:24PM by ayyzuk

No comments:

Post a Comment