title: How do I run an Angular Universal app and separate node app for backend api on Google App Engine?
body: <p>I hope someone out there can help me out!</p>
  <p>I have an Angular Universal app which I have deployed to Google App Engine.</p>
  <p>I have an app which is running on the default instance of the GAE and it has its own custom domain that I've configured.</p>
  <p>So now I want to run a separate node app which is basically just an express server with a mail api endpoint (/api/sendmail) to send mails.</p>
  <p>This endpoint will be running on http://localhost:3000/api/sendmail. Below are all my files.</p>
  <p>When I hit the endpoint <code>/api/sendmail</code>, and I check the logs using gcloud app logs tail -s servicename, it logs out <code>app.listen(3000, () =&gt; { console.log(&quot;The server started on port 3000&quot;);});</code>.</p>
  <p>But it doesn't seem to run the following. It doesn't run the console log?</p>
  <pre><code>app.post(&quot;/api/sendmail&quot;, (req, res) =&gt; {
      console.log(&quot;Got Request&quot;);
  }
  </code></pre>
  <p><strong>My package.json has these scripts</strong></p>
  <pre><code>&quot;start&quot;: &quot;node dist/server&quot;,
  &quot;deploy&quot;: &quot;ng build --prod &amp;&amp; npm run build:ssr &amp;&amp; gcloud app deploy --quiet &amp;&amp; gcloud app deploy dispatch.yaml --quiet&quot;,
  </code></pre>
  <p><strong>Proxy.conf.json file has this</strong></p>
  <pre><code>{
      &quot;/api&quot;: {
          &quot;target&quot;: &quot;http://localhost:3000&quot;,
          &quot;secure&quot;: false,
          &quot;logLevel&quot;: &quot;debug&quot;,
          &quot;pathRewrite&quot;: {
              &quot;^/api&quot;: &quot;&quot;
          }
      }
  }
  </code></pre>
  <p><strong>App.yaml</strong></p>
  <pre><code>runtime: nodejs10
  
  handlers:
      - url: /.*
        secure: always
        redirect_http_response_code: 301
        script: auto
  
  </code></pre>
  <p><strong>dispatch.yaml</strong></p>
  <pre><code>dispatch:
      - url: &quot;*/api/*&quot;
        service: lunr-app-backend
  
  </code></pre>
  <p><strong>This is my app.yaml which runs the node app on it's own service</strong></p>
  <pre><code>runtime: nodejs10
  service: servicename
  
  handlers:
    - url: /api/.*
      secure: always
      redirect_http_response_code: 301
      script: auto
  
  </code></pre>
  <p><strong>My node app has one file: nodemailer.js</strong></p>
  <pre><code>app.listen(3000, () =&gt; {
      console.log(&quot;The server started on port 3000&quot;);
  });
  
  app.post(&quot;/api/sendmail&quot;, (req, res) =&gt; {
      console.log(&quot;Got Request&quot;);
  }
  </code></pre>
  <p>Please let me know if anyone needs more info. Please check if you see something wrong.</p>