-
-
Notifications
You must be signed in to change notification settings - Fork 578
Conversation
…main func, also adding .env in the list of refreshables extensions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps generate a new .env
file for new projects, with comments inside as to how .env
works, the layout of the file, etc...
Currently, I don't know how that file works, so if I don't understand it, it's going to be hard for others. :)
@@ -34,6 +34,9 @@ var T *i18n.Translator | |||
// should be defined. This is the nerve center of your | |||
// application. | |||
func App() *buffalo.App { | |||
//Loading .env file values | |||
envy.Load() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this into buffalo.New
that way it'll just work for every app, and they don't need the extra line. Check to make sure that moving this doesn't cause any problems for older apps, as well as apps that don't have a .env
.
@markbates thanks for the feedback, I changed the |
@markbates what do you think about generating the SECRET_KEY on the .env by default ? |
I don't think it's good idea. In development that key doesn't really matter, it only matters in production. From my understanding of the .env file is that it's not supposed to be committed, but is for each developer to set up for their environment. If that is correct we should also add it to the default .gitignore |
Yes, it is ignored currently, right, was thinking developers to have environment as closer to production as possible, but you're right if it doesn't make a difference then I'll forget it 👍 |
Also, let me know if there is something else to do on this one and I'll jump into it, thanks for all the feedback! |
This PR adds
.env
support for generated buffalo apps, when generating a new buffalo app this adds an empty.env
file, adds that file to the.gitignore
and usesenvy.Load()
to load the.env
every time the application restarts.This PR also adds .env to the list of extensions that will be listened by refresh to restart the app, this is because it is cool to have the env change applied without stopping buffalo dev.
This is related with #606