Webpack dev server failed to configure reverse proxy

failed to configure the reverse proxy using webpack dev server. After I failed to configure the proxy in the project, I immediately downloaded a new vue cli to configure it, but it still didn"t work

.
  1. proxy Settings ( config/index.js )
    proxyTable: {
      "/api": {
        target: "http://xxx.xxx.xxx.xxx:81",
        changeOrigin: true,
        secure: false
      }
    },
  1. request
      const options = {
        news_type: 1,
        news_title: "",
        news_desc: "1111111111",
        news_url: "",
        images_url: "",
        id: 0
      }
      axios({
        method: "post",
        url: "/api/news/saveNews",
        data: options
      }).then(res => {
        if (res.data.status === "success") {
          this.$Message.success("")
        }
      })

3. Result


to delegate to http://xxx.xxx/news/saveNews, you need to rewrite the beginning / api as an empty string.

pathRewrite: {
    '^/api': ''
}

proxyTable: {
      '/api'  : {
                target      : 'http://192.168.125.174:81',
                changeOrigin: true,
                pathRewrite : {
                    '^/api': ''
                }
      }
    },
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-1e51316-43dcc.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-1e51316-43dcc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?