I'm having trouble setting up my www file, the file responsible for running my application both in my development environment, such as the production environment.
I'm constantly developing new things for my application on my development environment, then sending for the production, and I would like to set up my file responsible for creating the server and make it run in a dynamic way, without changing all the time that i need send to the production.
What I need is to make the following code to understand what environment the application is and apply the correct settings, without having to be manually.
This is the code that i am using in my development environment:
var app = require('../app');
var debug = require('debug')('myapp');
var http = require('http');
var server = http.createServer(app);
server.listen(3000, "0.0.0.0", function() {
var addr = server.address();
debug('Running on port ' + addr.address + ':' + addr.port);
});