Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

what is middleware in express js

var express = require('express')
var app = express()

var myLogger = function (req, res, next) {
  console.log('LOGGED')
  next()
}

app.use(myLogger)

app.get('/', function (req, res) {
  res.send('Hello World!')
})
Source by expressjs.com #
 
PREVIOUS NEXT
Tagged: #middleware #express #js
ADD COMMENT
Topic
Name
8+7 =