title: Node Js Angular 4 CORS
body: <p>Is it safe to allow CORS in NodeJS by allowing through ExpressJs?</p>
  
  <p>If " No " - How would I solve when my angularJs running on port - 4200 and NodeJS running on port - 3000 with error - "No-Access-Control-Allow-Origin"</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((request,response,next) =&gt; {
    response.setHeader('Content-Type', 'application/json');
    response.header("Access-Control-Allow-Origin", "*");
    response.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();    
  })</code></pre>
  </div>
  </div>
  </p>