-
Hi, I'm trying to set up a simple dev proxy where the auth endpoints are proxied to another service. Basically to avoid CORS issues. In order to make this work, I have to rewrite the host part of the This is my setup: const app = express();
app.use(
'/api/auth',
createProxyMiddleware({
target: 'https://playground.projects.oryapis.com',
changeOrigin: true,
pathRewrite: {
'/api/auth': '/'
},
logger: console,
plugins: [simpleRequestLogger],
secure: false,
selfHandleResponse: true,
on :{
proxyRes: responseInterceptor(async (responseBuffer, proxyRes, req, res) => {
return responseBuffer;
})
}
})
);
app.use(
'/',
createProxyMiddleware({
target: 'http://localhost:3000',
logger: console,
})
); My versions are as follows:
I'm also developing on Github Codespaces. |
Beta Was this translation helpful? Give feedback.
Answered by
chimurai
Aug 5, 2022
Replies: 1 comment 1 reply
-
Dupe of #807 (comment) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
CanLikeTo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dupe of #807 (comment)