Skip to content

Instantly share code, notes, and snippets.

@packetchef
Created November 9, 2018 00:59
Show Gist options
  • Save packetchef/6fba98558ae18b975eb4986dc59da3b6 to your computer and use it in GitHub Desktop.
Save packetchef/6fba98558ae18b975eb4986dc59da3b6 to your computer and use it in GitHub Desktop.
const port = 3000
const express = require('express')
const app = express()
app.use(function(req, res, next){
console.log('Request:', req)
console.log('Response:', res)
next()
})
app.get('/', function(req, res, next){
res.send('Hello')
res.send(req.parm1)
})
app.get('/parms', function(req, res, next){
var parm1 = req.parm1
var parm2 = req.parm2
if ( parm1 && parm2 ){
next()
}
})
app.listen(port, function(){
console.log('Listening on port', port)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment