vania-dart / framework

Fast, simple, and powerful backend framework for Dart built with ❤️
https://vdart.dev
MIT License
155 stars 12 forks source link

Missing env keys since 0.1.7+1 #40

Closed D3R50N closed 2 months ago

D3R50N commented 2 months ago

Hello. Lastly I opened an issue #29 and it was about .env not loaded. When you fixed it, I can't anymore run the project locally (neither deploy in prod). It still giving errors like this Unhandled exception: FormatException: Invalid boolean null.

So I modified directly your package (this file src/env_handler/env.dart) and I've found there were some missing keys in the old generated .env :

APP_SECURE=false
APP_CERTIFICATE=''
APP_PRIVATE_KEY=''
APP_PRIVATE_KEY_PASSWORD=''

I don't really know what kind of values I can pass, but it seems : APP_SECURE is a boolean. When true, you should provide the 3 others one. APP_CERTIFICATE a path maybe ? APP_PRIVATE_KEY also a path ? APP_PRIVATE_KEY_PASSWORD just a string.

So, I'm creating this issue to notice and help fix.

Waiting for your updates :)

javad-zobeidi commented 2 months ago

1) The env method allows you to pass a default value, but I will certainly update it to include some default values. I wanted the APP_PORT to be the same in both the .env file and platform environments to avoid confusion for developers who are not familiar with the backend. 2) I will update the documentation. 3) The template has been updated and includes all the necessary environment settings. 4) Please use the latest version.

5) If possible, could you create a guide in the deploying section for Render?

Thank you for the explanation.

D3R50N commented 2 months ago

Okay. Of course. Should I write it in comment of this issue ?

javad-zobeidi commented 2 months ago

For doc use this repo https://github.com/vania-dart/documentation

Make a fork and then PR

D3R50N commented 2 months ago

It's done. Check the pull request..