title: axios request to node.js server not returning data
body: <p>Edit: Just a typo that I missed.
  I apologize. Thank you Alexander</p>
  
  <p>I am not getting response data in my client.
  However when I use postman, I get the data i need.
  On console I get the following error.
  Any idea why I am getting this problem?</p>
  
  <pre><code>Error: Request failed with status code 404
      at createError (createError.js:16)
      at settle (settle.js:17)
      at XMLHttpRequest.handleLoad (xhr.js:61) "error"
  </code></pre>
  
  <p>Server-side</p>
  
  <pre><code>const express = require("express");
  const genreData = require("../data/genreData.json")
  const fs = require ('fs')
  const router = express.Router();
  
  router.get("/", (_, res) =&gt; {
      res.json(genreData);
    });
  
  router.get("/:id", (req, res) =&gt; {
      res.json(genreData.find(user =&gt; user.id == req.params.id))
  })
   module.exports = router;
  </code></pre>
  
  <p>Client-side</p>
  
  <pre><code>import React, { Component } from 'react'
  import axios from 'axios'
  
  export class Result extends Component {
      constructor (props) {
          super (props) 
              this.state = {
                  user: {}
              }
      }
      componentDidMount () {
          axios.get(`http:/localhost:8001/genre/${this.props.match.params.id}`)
          .then(res =&gt; 
              this.setState({user: res.data}))
          .catch(error =&gt; {
              console.log(error, "error")
          })
      }
      render() {
          console.log(this.state.user)
          return (
              &lt;div&gt;
                  &lt;p&gt;{this.state.user.id}&lt;/p&gt;
              &lt;/div&gt;
          )
      }
  }
  
  export default Result
  </code></pre>
  
  <p>Postman get request to <a href="http://localhost:8001/genre/52163492-5e66-4bbf-a3dc-2b8120e3afe8" rel="nofollow noreferrer">http://localhost:8001/genre/52163492-5e66-4bbf-a3dc-2b8120e3afe8</a></p>
  
  <pre><code>{
      "id": "52163492-5e66-4bbf-a3dc-2b8120e3afe8",
      "action": 3,
      "anime": 4,
      "children": 5,
      "comedy": 2,
      "documentary": 4,
      "drama": 5,
      "horror": 5,
      "musical": 5,
      "scifi": 5,
      "thriller": 5
  }
  </code></pre>