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,


Then the cross domain problem is solved


2 Replies
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')

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.