lynaghk / cljx

Write a portable codebase targeting Clojure/ClojureScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Environment variables

okal opened this issue · comments

commented

I'd like to make some server environment variables available to CLJS, through something like environ. Does cljx enable this sort of functionality?

No. Depending on when you're compiling your ClojureScript, that's something you'll want to splice into your CLJS source via a macro, or make available in your JS runtime explicitly (e.g. always load something like "window.__environment = {…}" first, and refer to it in your ClojureScript via js/window.__environment).

commented

Thanks. Wound up using a macro.