10 questions · Node.js · intermediate level
Which HTTP method is idempotent — calling it multiple times gives the same result?
What is CORS and why is it needed?
What does this middleware do?
app.use((req, res, next) => {
const start = Date.now()
next()
const duration = Date.now() - start
console.log(`${req.method} ${req.url} - ${duration}ms`)
})