Can I get the value of an environment variable in routes.php (or other config files)?
I think you'll just need to do something like this in your routes.php file:

$general = require __DIR__.'/general.php';

return array(
    'foo' =&gt; $general['environmentVariables']['bar'],
);