Skip to content

Added config.production.json for easy installation to heroku (or any other).#433

Open
bauripalash wants to merge 2 commits into
eduardoboucas:masterfrom
bauripalash:master
Open

Added config.production.json for easy installation to heroku (or any other).#433
bauripalash wants to merge 2 commits into
eduardoboucas:masterfrom
bauripalash:master

Conversation

@bauripalash

Copy link
Copy Markdown

For newbie staticman users it was quite a hassle to setup staticman with heroku. It wouldn't work just out of the box. It took me about an hour to understand why this was not working.
This PR will help users to get started with Staticman + Heroku (or any other) pretty easily. Just setup your site and add environment variables to heroku app settings and Done! ❇️

@hispanic

hispanic commented Sep 5, 2021

Copy link
Copy Markdown

This caused me headaches when I started working with Staticman, too. I did exactly what you did. However, I came to realize that the config.production.json file is not needed when running in Heroku, especially for the purpose of simply pointing at the environmental variables. The convict documentation speaks to this. In Heroku, I have multiple Staticman apps, one each for dev, staging, and production. I do not source/provide a config.[env].json file for any of them.

I do, however, maintain a config.development.json file for local development (because I find it easier to maintain/adjust those settings locally via a file instead of via environmental variables). But, I do not source it.

@jamesmortensen

Copy link
Copy Markdown

Hi @hispanic when I see the convict documentation, my understanding is that any environment variables set in Heroku would override anything in config.production.json. If my understanding is correct, then I think that means I should not need a config.production.json to get this working on Heroku.

In @bauripalash pull request, I see there's a config.production.json. Can you please help me understand whether the json file is needed or not for Heroku deployment? Thank you.

@hispanic

Copy link
Copy Markdown

@jamesmortensen Correct, a config.production.json file should not be needed in Heroku. Of course, this assumes that you have set the environment variables either via the GUI or command line.

@jamesmortensen

Copy link
Copy Markdown

Thanks for the reply. I did get it working, but I still need to style the form and the comment view. It seems another thing we could use are some standard Staticman CSS templates to make it easier to get started.

Thanks for all your work on this. It should be the future for how content is delivered to users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants