how to run / execute app deployed on heroku
<p>I am new to node.js and heroku. 
By following docs and some tutorials I have successfully deployed my app on heroku.   </p>

<p>The problem I am facing is that I don't know how to run that deployed app on heroku. After reading a number of tutorials, its still not clear to me. </p>

<p>When I run the commands</p>

<pre><code>$ git add .
$ git commit -am "make it better"
$ git push heroku master
</code></pre>

<p>from local command line, it executes the scripts. But when I click on the open app from the heroku account, it does not execute all of files. </p>

<p>I am running 1 web dynos and heroku shows that my web dyno executes following command</p>

<pre><code>web node build/server.js
</code></pre>

<p>The <code>server.js</code> file contains following code</p>

<pre><code>require('./routes/main.routes.js');

var http = require('http'); 
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end("this is a test page");
}).listen(process.env.PORT);
</code></pre>

<p>when I click on open app from heroku, it opens the app in the browser with message<br>
<code>this is a test page</code>  </p>

<p>It does not run the <code>main.routes.js</code> file.<br>
But when I click on restart all Dynos, the <code>main.routes.js</code> file also gets executed. I want the app to execute the <code>main.routes.js</code> file when I click on open my app or refresh it in the browser window. </p>

<p>Is the restart all Dynos only way to execute script? or I have done something wrong?</p>

<p>Any help will be much appreciated. </p>