node.js - Express request cross-domain problem, the request interface just doesn't work
三叔
三叔 2017-06-17 09:16:10
0
2
696

I want to host the files packaged by vue on node. The static file service has also been started. Now I want to use node to handle post requests in Axios. I also configured cross-domain requests


Access-Control-Allow-Headers Neither configuration works.
The interface has a login,

Then browser cross-domain issues

三叔
三叔

reply all(2)
淡淡烟草味

Now that the vue project has been packaged, can’t you just put it in the public directory under the node project? Not setting app.use(express.static(path.join(__dirname, 'public'))); Well

Peter_Zhu

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!