apache/incubator-baremaps

How to fetch env variables in style.js/tileset.js

polastre opened this issue · 2 comments

Is there a way to use process.env in those files or in a config.js that is loaded in?

I get the error:

java.io.IOException: org.graalvm.polyglot.PolyglotException: ReferenceError: process is not defined

which seems to be an artifact of using Polyglot.

Any suggestions?

The environment variables were not yet exposed to the javascript execution context. After merging #776, you should be able to access them as follow:

env["VARIABLE_NAME"];

The following should print all the variables:

console.log(JSON.stringify(env, null, 2));

This would be fantastic.