3 ms·
> it's standard practice to listen for PORT over the environment variable I didn't think of this, I was thinking of making something like config file where use
by adalricus 7y ago
> it's standard practice to listen for PORT over the environment variable
I didn't think of this, I was thinking of making something like config file where user can specify it. This will be a lot better than that, so I could ask users to set CORTRIS_PORT & read that?
edit: I'm now reading port from environment & setting it to 8080 if it doesn't exist.
> you are opening and closing your DB on every request
I don't understand about controllers part, could I open the db at start & put db.Close() at end of main (?), is there more I have to think of (like what happens after program fails & the connection is still open?)
> http.Error(w, err.Error(), 500)
Is it safe to pass the error to the user? Could something go wrong considering the source is already world readable?
It would be nice if anyone could set it up on heroku free tier, where do I learn about it?
I'm planning on getting a cheap vps to deploy my little projects. Thank you for looking at my project!
- adalricus 7y agoI've implemented these since then, I also read the database file from environment now.