title: Get real image path from json response
body: <p>I have a local express server that serves a json file. I also have many image files inside a local folder. The image paths are parts of the json object which I want to show in my DOM. However I get string representation of these image paths as part of response which I can't use. What is the best way to server local images to the frontend from a local server.  </p>
  
  <p><strong>A picture of the issue</strong>:<a href="https://i.stack.imgur.com/NYXbV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NYXbV.png" alt="enter image description here"></a></p>
  
  <p>My server side config:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>app.use(express.static(path.join(__dirname, 'public')))
  app.use(express.static(path.join(__dirname, 'server/img')))</code></pre>
  </div>
  </div>
  </p>
  
  <p>My JSON file</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    "Images": [{
      "title": "First Block",
      "images": ["server/img/bijay.jpg", "server/img/dance.png", "server/img/ocean.jpg"]
    }, {obj2}, {obj3}, {obj4}]
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>My client-side code to print image</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ul&gt;
    &lt;li ng-repeat="obj in objArray"&gt;&lt;img ng-src="{{obj.images[0]}}"&gt;&lt;/li&gt;
  &lt;/ul&gt;
  // just testing first image</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>My folder structure:</strong>  </p>
  
  <p><a href="https://i.stack.imgur.com/BwqkX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BwqkX.png" alt="images are inside img folder. not shown to save space"></a></p>
  
  <p>Images are inside the img folder. not shown here to save space</p>