Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

middleware in node 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!')
})

app.listen(3000)
Source by expressjs.com #
 
PREVIOUS NEXT
Tagged: #middleware #node #js
ADD COMMENT
Topic
Name
3+8 =