title: Connecting Vue to Express - 404 Not Found
body: <p>I'm creating a simple app to practice connecting Vue to an Express server. I have a form that I'm attempting to send to the back end, but I can't seem to get my data to the back-end. 
  The error I'm receiving is:</p>
  
  <blockquote>
    <p>POST <a href="http://localhost:8080/login" rel="nofollow noreferrer">http://localhost:8080/login</a> 404 (Not Found)</p>
  </blockquote>
  
  <p>My best guess is that the method in my Vue can't find a matching route on my server? If so, I'm confused as I have a route for login.</p>
  
  <p><strong>In my Vue script:</strong></p>
  
  <pre><code>const axios = require('axios');
  
  export default {
      data: function() {
          return {
            user: {
              email: '',
              password: ''
            }
          }
      },
      methods: {
        sub() {
          var user = {
            email: this.user.email,
            password: this.user.password
          }
          axios.post('/login', user)
            .then(res =&gt; console.log(res))
            .catch(err =&gt; console.log(err))
        }
      }
  }
  </code></pre>
  
  <p><strong>On by back-end:</strong></p>
  
  <pre><code>const path = require('path');
  const express = require('express');
  
  const app = express();
  
  app.use(express.static(path.join(__dirname, '..')));
  
  app.post('/login', function(req, res) {
    console.log("Server HIT!!!!!!!!!!!!!!!!!!!!")
  })
  
  app.get('*', function (req, res) {
    return res.sendFile('../index.html');
  });
  
  app.listen(3000);
  console.log('Express server listening on port 3000');
  </code></pre>