Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Config Vars #21

Closed
wants to merge 7 commits into from
Closed

Config Vars #21

wants to merge 7 commits into from

Conversation

hone
Copy link
Member

@hone hone commented Jan 14, 2016

The buildpack will read any env vars that are prefixed with HEROKU_STATIC_ and write out a file accessible at /--/env.js and /--/env.json. The /--/env.js file will create a JavaScript object __env on window. Where the /--/env.json will just be a JSON representation.

An example how this will look:

If the env vars are set, FOO will be picked up but BAR will not be.

$ heroku config:set HEROKU_STATIC_FOO=foo BAR=bar

/--/env.js:

window.__env = {
  "FOO": "foo"
}

/--/env.json:

{
  "FOO": "foo"
}

@hone
Copy link
Member Author

hone commented Jan 14, 2016

@mattcreager @ojacobson any other thoughts on this?

@jmervine
Copy link

Love the idea and don't see any issues with implementation at a glance.

@mattcreager
Copy link

@hone without this feature, I'm going to be forced to setup a seperate API to serve env specific configuration.

@dmathieu
Copy link

This is an awesome idea.

@hone
Copy link
Member Author

hone commented Jun 30, 2016

@mattcreager can you explain your use case a bit more? I can rebase this PR against master for the time being.

@ojacobson
Copy link
Contributor

I'm actually doing something a lot like this in one of my own apps (which uses Node, rather than this buildpack): have a look and here.

The underlying motivation for me is almost exactly what it would be in a server-side app: to provide per-deployment values such as tokens, and to bind external resources (the API service, in this case) to the deployment.

@josephabrahams
Copy link

👍

Any plans to pull this soon-ish?

@bengotow
Copy link

This seems like a great idea to me—merge soon?

@narwajea
Copy link

In the meantime, is there any way to access env variables at build time ?

@edmorley
Copy link
Member

edmorley commented Jun 9, 2022

Hi!

This buildpack is now deprecated and we are recommending people move the more actively maintained heroku-buildpack-nginx. For migration advice see here.

As such, I'm closing this PR out since we won't be making further changes to this buildpack.

@edmorley edmorley closed this Jun 9, 2022
@edmorley edmorley deleted the config branch June 9, 2022 22:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants