undefinedfix
Sign in

Express request cross domain problem, the request interface is not

qwiou edited in Thu, 18 Feb 2021

After Vue is packaged, I want to host the file to node, and the static file service is also up. Now I want to use node to process the post request in Axios, and I have also configured cross domain request

Access control allow headers is not available. The interface has a login,

clipboard.png

Then the cross domain problem is solved

clipboard.png

2 Replies
Amer
commented on Thu, 18 Feb 2021

Now that the Vue project has been packaged, don't you just put it in the public directory under the node project? It's not a setting app.use ( express.static ( path.join (__ Dirname, 'public')

dwwlv
commented on Thu, 18 Feb 2021

You try to app.use ('/', index) app.all ('*',...) below.

lock This question has been locked and the reply function has been disabled.