title: Deploying Angular 4 with Node Express Server in Firebase
body: <p>I created an angular 4 project using angular cli.</p>
  
  <p>Now i install express and my app.js file is </p>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>const express = require('express')
  const app = express()
  const bodyParser = require('body-parser');
  const path = require('path');
  const http = require('http');
  const firebase = require("firebase");
  
  app.use(express.static(path.join(__dirname, 'dist')));
  
  var api = require('./server/routes/api');
  
  app.use('/api', api);
  app.get('*', (req, res) =&gt; {
       res.render(path.join(__dirname, 'index.html'));
  
  });
  
  
  // Initialize Firebase
  // TODO: Replace with your project's customized code snippet
  //NOTE : I have replace the credentials
  var config = {
      apiKey: "&lt;API_KEY&gt;",
      authDomain: "&lt;PROJECT_ID&gt;.firebaseapp.com",
     databaseURL: "https://&lt;DATABASE_NAME&gt;.firebaseio.com",
     storageBucket: "&lt;BUCKET&gt;.appspot.com",
    };
  firebase.initializeApp(config);
  
  app.listen(3000, function () {
    console.log('Example app listening on port 3000!')
  })
  </code></pre>
  
  <p>Now if i run </p>
  
  <pre><code>npm app.js
  </code></pre>
  
  <p>my localhost:3000 is working and my angular js dist folder is displayed in the browser.</p>
  
  <p>If i run localhost:3000/api i am getting my api calls.</p>
  
  <p>Now, how to deploy this to firebase.</p>
  
  <p>I tried firebase.init in a seperate folder, which was creating a set of json files... </p>
  
  <p>Still its not clear, how to deploy (i need my server folder, dist folder )to be copied along with app.js to firebase app.</p>
  
  <p>Hope i was clear. Downvoters are welcome with proper reasoning.</p>