title: Sending a JSON file to Express server using JS
body: <p>I am fairly new to JS and I have a JSON file that I need to send to my server (Express) that I can then parse and use its contents throughout the web app I'm building. </p>
  
  <p>Here's what I have now:</p>
  
  <ul>
  <li>a JSON file named data.json</li>
  <li>an Express server set up that is running on a localhost</li>
  <li><p>some shitty code:</p>
  
  <p>app.get('/search', function (req, res) {
   res.header("Content-Type",'application/json');
   res.send(JSON.stringify({/data.json/}));
  });</p></li>
  </ul>
  
  <p>In the code above I am just trying to send the file to localhost:3000/search and see my JSON file, but all I receive when I go to that path is { }. Can anyone explain?</p>
  
  <p>Any help would be immensely appreciated. Thanks so much in advance.</p>
  
  <p>Cheers,
  Theo</p>
  
  <p>Example snippet from data.json:</p>
  
  <pre><code>[{
      "name": "Il Brigante",
      "rating": "5.0",
      "match": "87",
      "cuisine": "Italian",
      "imageUrl": "/image-0.png"
  }, {
      "name": "Giardino Doro Ristorante",
      "rating": "5.0",
      "match": "87",
      "cuisine": "Italian",
      "imageUrl": "/image-1.png"
  }]
  </code></pre>