How to define a "constant" and access it everywhere in NodeJS

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.

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 BASE URL and then can be accessed anywhere (libraries, controllers, models, views...) with a simple function. Pretty standard stuff.

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 res.locals or app.locals, which is not working. I'm using Express 3.1.1 and the ejs-locals 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.

Thanks.

in app.js just change this

 var myVar = "only in file";

with this (without "var")

 myVar = "everywhere";

It's better if you do it just in case.