Problems with configuring request agents in react projects

the following code has been added to service.js

const proxy = require("http-proxy-middleware");//
const apiProxy = proxy("/api", {
        target: "https://api.douban.com",
        changeOrigin: false
    });
    app.use("/api", apiProxy);

image

http://localhost:8888/api/v2/music/search?q=%E5%91%A8%E6%9D%B0%E4%BC%A6&v=1526873684320
image


https://api.douban.com/v2/mus...

clipboard.png

Mar.12,2021

1. The picture given can only show 500error
2. Before using the proxy, try to see if the address after the proxy can be used, and then try to see if the address before the proxy can be used
3. If you have tried all of the above, then there is more than one picture. The problem of


has been solved. The location of this code for setting the proxy needs to be adjusted to before express processes the request

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-249a3cc-2a24.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-249a3cc-2a24.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?