title: Angular + node.js, setting the image static path (relative path)
body: <p>I'm wanting to set the static path with node.js in <code>app.js</code>.</p>
  
  <p>Such as the follow with setting in the <code>public</code> folder:</p>
  
  <pre><code>app.use(express.static(path.join(__dirname, 'public')));
  </code></pre>
  
  <p>When I use template engines, such as <code>mustache</code> <code>https://mustache.github.io/</code>，
  you can set it using a relative path in the template to get a photo <code>a.jpg</code>, like:</p>
  
  <pre><code>&lt;img src="./a.jpg"&gt;
  </code></pre>
  
  <p>When I save a user's photo in the <code>public</code> folder. </p>
  
  <p>In Angular, how do I set the img url relative path from the node.js server folder.</p>
  
  <p>If I save the the full URL in the <code>DB</code> and set the URL in <code>img</code>:</p>
  
  <pre><code>    http://120.8.12.8:3000/a.jpg
      //or
      http://domainname:3000/a.jpg
  </code></pre>
  
  <p>html:</p>
  
  <pre><code>&lt;img src="http://120.8.12.8:3000/a.jpg"&gt;
  &lt;img src="http://domainname:3000/a.jpg"&gt;
  </code></pre>
  
  <p>When I change the IP or domain name, the URL will fail.
  How can I set it?</p>