Replies: 1 comment
-
I added a '/' behind target uri and now it seems to work. No CORS error anymore. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, maybe someone have run into same problem sometime and find a solution.
I tried to implement an authentication between docusaurus as client and laravel (PHP) as server and run into CORS problems. I tried to write a plugin for webpack proxy, but it doesn't help anything.
Plugin is like from stack overflow https://stackoverflow.com/questions/70601729/how-to-proxy-request-in-docusaurus-v2
// plugins/webpack/index.js module.exports = function (context, options) { return { name: "cusotm-webpack-plugin", configureWebpack(config, isServer, utils) { return { mergeStrategy: { "devServer.proxy": "replace" }, devServer: { proxy: { "/auth: { target: "http://localhost:8000", secure: false, changeOrigin: true, logLevel: "debug", }, }, }, }; }, }; };
When I try to catch the data from server without docusaurus all will work fine. So I thought the problem is the webpack Dev server.
I hope someone got a solution!
I would really like to use docusaurus as client for a web app with some dynamic sites.
Beta Was this translation helpful? Give feedback.
All reactions