title: How to define a "constant" and access it everywhere in NodeJS
body: <p>I'm fiddling a bit with node.js and during my (so called) project I stumbled upon a problem that, although not totally deterrent, annoys the hell out of me.</p>
  
  <p>I work with PHP framework CodeIgniter everyday, and something that CodeIgniter has (and probably any other PHP framework has too) is a way to define once the <strong>BASE URL</strong> and then can be accessed anywhere (libraries, controllers, models, views...) with a simple function. Pretty standard stuff.</p>
  
  <p>Now, in Express I can't find a way to do the same. I wandered through questions on SO from people asking something similar, and usually the answers would be about <code>res.locals</code> or <code>app.locals</code>, which is not working. I'm using Express 3.1.1 and the <strong>ejs-locals</strong> as a template engine. I know I can define a global variable and then pass it to the render function, but I was wondering if there is a way (that works) to access it everywhere. I believe the problem might be the Template engine, but, it would be nice to have a second opinion.</p>
  
  <p>Thanks.</p>