Created
October 25, 2020 18:30
-
-
Save jmrobles/c0de639205319c689452f430cfe89ba9 to your computer and use it in GitHub Desktop.
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
const PROXY_CONFIG = { | |
"/api": { | |
"target": "http://my-backend.com", | |
"changeOrigin": true, | |
"secure": false, | |
"logLevel": "debug", | |
"onProxyRes": function(pr, req, res) { | |
if (pr.headers['set-cookie']) { | |
const cookies = pr.headers['set-cookie'].map(cookie => | |
cookie.replace(/;(\ )*secure/gi, '') | |
); | |
pr.headers['set-cookie'] = cookies; | |
} | |
} | |
} | |
}; | |
module.exports = PROXY_CONFIG; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment