Skip to content

Instantly share code, notes, and snippets.

@kendricktan
Created April 11, 2021 21:58
Show Gist options
  • Save kendricktan/4c875560e6b47dd3774ea50443caaf2e to your computer and use it in GitHub Desktop.
Save kendricktan/4c875560e6b47dd3774ea50443caaf2e to your computer and use it in GitHub Desktop.
node-js-http-proxy
var proxy = require('express-http-proxy');
var app = require('express')();
var cors = require('cors')
var morgan = require('morgan')
app.use(cors())
app.use(morgan('combined'))
app.use('/', proxy('google.com'));
app.listen(3000, function() {
console.log('Server listening on port 3000')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment