title: Axios request pending, but work on postman
body: <p>my Problem is:</p>
  
  <p>I am creating an Nuxt application and i am testing the API endpoints. </p>
  
  <p>For example when i using Postman and i send this request with POST:</p>
  
  <pre><code>localhost:3000/api/login
  </code></pre>
  
  <p>Everything is ok and i get the expected result back but when i try it on my client side with this:</p>
  
  <pre><code> axios
        .post("/api/login", {
          email: email,
          password: passwort
        })
        .then(res =&gt; {
          console.log(res);
        });
  </code></pre>
  
  <p>On the network tab in google chrome i see that the request is pending and i dont know why.</p>
  
  <p>Here is my <code>index.js</code> file:</p>
  
  <pre><code>  const express = require("express");
    const app = express();
    const mongoose = require("mongoose");
    const bodyParser = require("body-parser");
  
    mongoose.connect(
      "mongodb+srv://mydata/realtime?retryWrites=true&amp;w=majority",
      {
        useNewUrlParser: true,
        useUnifiedTopology: true
      }
    );
  
  
    app.use(bodyParser.json());
    const routes = require("./routes/routes");
    app.use(routes);
    module.exports = {
      path: "/api",
      handler: app
    };
  </code></pre>
  
  <p>This is my routes folder:</p>
  
  <pre><code>const { Router } = require("express");
  const router = Router();
  
  import createUser from "../controllers/user";
  import checkLogin from "../controllers/login";
  /* GET users listing. */
  
  router.post("/login", checkLogin);
  router.post("/register", createUser);
  
  module.exports = router;
  </code></pre>
  
  <p>and my <code>login.js</code> file:</p>
  
  <pre><code>const bcrypt = require("bcrypt");
  import User from "../models/user";
  export default async function checkLogin(req, res) {
    const user = await User.findOne({ email: req.body.email });
    if (!user) {
      return res.status(404).json({
        success: false,
        message: "Diese E-Mail konnte nicht verifiziert werden."
      });
    }
    const checkPw = bcrypt.compareSync(req.body.password, user.password);
    if (checkPw) {
      res.status(200).json({
        success: true,
        message: "Erfolgreich eingeloggt"
      });
    } else {
      return res.status(403).json({
        success: false,
        message: "Falsche Passwort"
      });
    }
  }
  </code></pre>
  
  <p>EDIT: </p>
  
  <p>I have founded the issue, i have forgot the <code>this</code> keyword in the data i pass:</p>
  
  <pre><code> axios
    .post("/api/login", {
      email: this.email,
      password: this.passwort
    })
    .then(res =&gt; {
      console.log(res);
    });
  </code></pre>