-
It seems no matter what config I try and simply can't seem to get paths to proxy. I've tried a number of combinations of... proxy: {
prefix: '/api',
url: `http://6005e7693698a80017de1170.mockapi.io`,
}, and trying tons of combos of this... developMiddleware: (app) => {
app.use(
'/api',
createProxyMiddleware({
target: 'http://6005e7693698a80017de1170.mockapi.io',
changeOrigin: true,
secure: false, // Do not reject self-signed certificates.
logLevel: 'debug',
})
)
}, When I visit ...and when I visit ...and in the console I see this... When this is working.... would it not show the path beside the target here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Got it working with Advanced Proxy. This worked for me... developMiddleware: (app) => {
app.use(
'/api',
createProxyMiddleware({
target: 'https://6005e7693698a80017de1170.mockapi.io',
changeOrigin: true,
pathRewrite: { '^/api': '/' },
logLevel: 'debug',
})
)
}, |
Beta Was this translation helpful? Give feedback.
Got it working with Advanced Proxy.
My issue was in understanding how the initial path worked.
You HAVE to strip it out if you don't want it on the other side.
This worked for me...