title: how to run angular 6 app with nodejs api on production?
body: <p>Hi I am new to angular6  </p>
  
  <p>In development mode I have worked in angular 4200 port and node in different port (8080) in my operations.
  but now I want to move my app into production mode. 
  for that I had build my angular project by using <strong><code>ng build</code></strong> command. after i get a dist folder is created on the root folder.</p>
  
  <p>so i went to server.js file 
  here I  had add my static file </p>
  
  <pre><code>app.use(express.static(path.join(__dirname,'dist/MDProject')));
  
  app.use('/',(req,res)=&gt;{
  
      res.sendFile(path.join(__dirname,'dist/MDProject/index.html'))
  });
  </code></pre>
  
  <p>click here to read my <a href="https://www.writeurl.com/text/kssiyj702qx55qwn5yne/w89tunlc54w2vf38qoq6" rel="nofollow noreferrer">server.js</a> file</p>
  
  <p>by this 
  when ever I redirect to my local host it is opening but 
  in server.js side i didn't get any response.</p>
  
  <p>when ever I try to login I am getting this error.
  <a href="https://i.stack.imgur.com/atdfI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/atdfI.png" alt="enter image description here"></a></p>
  
  <p>can anyone help me to solve this</p>