title: Vuejs proxy not working with webpack template
body: <p>I am developing a vuejs project with the <a href="https://github.com/vuejs-templates/webpack/" rel="nofollow noreferrer">webpack</a> template on localhost i.e. url: <code>localhost:8080</code> but I have an express server running in <code>https://foo.bar.com</code></p>
  
  <p>In the past, I have been making a direct request to the express server by disabling CORS, but now I am trying to make a request via proxy. </p>
  
  <p>According to this <a href="https://vuejs-templates.github.io/webpack/proxy.html" rel="nofollow noreferrer">API Proxying During Development</a> I have added the following to my <code>config/index.js</code></p>
  
  <pre><code>proxyTable: {
    // proxy all requests starting with /api to jsonplaceholder
    '/': {
    target: 'https://foo.bar.com',
    changeOrigin: true,
    pathRewrite: {
    '^/': ''
    }
  }
  </code></pre>
  
  <p>And in my login page <code>components/login.vue</code></p>
  
  <p>I have something like this: </p>
  
  <pre><code>...
  methods: {
    Login(){
       // trying 3 times with different urls
      api.request('post', 'login', {email, password}).then().catch()
      api.request('post', '/login', {email, password}).then().catch()
      api.request('post', 'https://foo.bar.com/login', {email, password}).then().catch()
    }   
  }
  </code></pre>
  
  <p>But I get an error like this: </p>
  
  <p><code>Failed to load https://foo.bar.com/login: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.</code></p>