Skip to content

Instantly share code, notes, and snippets.

@harish2704
Created August 7, 2017 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harish2704/4db71f8c1c124e578aed688a936cdbea to your computer and use it in GitHub Desktop.
Save harish2704/4db71f8c1c124e578aed688a936cdbea to your computer and use it in GitHub Desktop.
Dummy express server for logging in comming request
var express = require('express');
var app = express();
var port = process.env.PORT || 4005;
app.use( function( req, res ){
[
'method',
'url',
'headers',
'query',
'body'
]
.forEach(function( item ){
console.log( item, req[item] );
});
res.send('Ok');
});
app.listen( port, function( err ){
if( err ){
console.log( 'Error', err );
process.exit( -1 );
}
console.log( 'Listening on '+ port );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment