title: Issue with Vue.js devServer.proxy
body: <p>So in an application that I'm working on currently I'm trying to proxy requests from a Vue-frontend, to an Express-server. The express server is running on localhost:5000. This is in my vue.config.js:</p>
  <pre><code>    &quot;devServer&quot;: {
      &quot;proxy&quot;: {
        &quot;^/api/&quot;: {
          &quot;target&quot;: &quot;http://localhost:5000&quot;,
          &quot;ws&quot;: true,
          &quot;changeOrigin&quot;: true
        }
      }
    },
  </code></pre>
  <p>What I can't wrap my head around is why in most cases, sending out requests to my server with just <em>api/routename</em> works just fine. Then in only 2 components it doesn't work. In the components where it does work, a GET request looks like this for example:</p>
  <pre><code>axios.get('api/base/verified')
  .then...
  
  </code></pre>
  <p>Then in two other components, according to the same principle of just requesting to <em>api/route-name</em>, I'm getting errors. In development mode, the requests then all of a sudden go out to http://localhost:8080/api..., and when trying to deploy, they go to 5000, but I get this error message:</p>
  <p>xhr.js:184 GET http://localhost:5000/api/content/course/5f54f3c60bb7a30017c1abf2 net::ERR_CONNECTION_REFUSED</p>
  <p>Does anyone have any idea about what the deal is, and why the proxying is acting so differently, depending on environment and component?</p>