nosocoin / noso-faucet

A faucet implementation for Noso Coin
The Unlicense
3 stars 1 forks source link

Another suggestion: All URLs should be relative #8

Closed gcarreno closed 2 years ago

gcarreno commented 2 years ago

Hey Andrii (@pasichDev),

I've noticed that in both your initial code and this new version that you always have a config variable with the site and port.

This should either be inferred from the $_SERVER array, or never be mentioned anywhere by always using relative paths.

This allows for very easy deployments without having to have another variable to configure.

We have config vars for the stuff we can't get from $_SERVER and/or $_ENV, like database credentials and such. The rest must be collected from the environment that the app is residing, not ask the person that deploys to have another variable to mess up :smiley: Humans tend to make mistakes. Collecting data from the environment is safer that having a human guess what it is.

Cheers, Gus

pasichDev commented 2 years ago

Hello @gcarreno , you are right, it was implemented illogically!

pasichDev commented 2 years ago

Hi @gcarreno , I already fixed it, you can close the issue!

gcarreno commented 2 years ago

Hey Andrii (@pasichDev),

you are right, it was implemented illogically!

Not completely illogical, no. A lot of the frameworks have some kind of variable with the same info. The difference is that they try and get it from the running environment and avoid being a fixed constant :smiley:

I already fixed it, you can close the issue!

That is awesome, I'll do that :smiley:

Cheers, Gus