Created
April 11, 2021 21:58
-
-
Save kendricktan/4c875560e6b47dd3774ea50443caaf2e to your computer and use it in GitHub Desktop.
node-js-http-proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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