Closed ad-on-is closed 6 months ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I had the same problem, http://127.0.0.1:3333
is a valid url but http://localhost:3333
is not.
that's confusing.
This happens because the http://localhost:3333
does not have a tld
on it. Here's the docs to allow URLs without tld
https://docs.adonisjs.com/guides/environment-variables#url.
Why does it allow http://127.0.0.1:3333
? I am not sure, we use https://github.com/validatorjs/validator.js, so maybe there is some exception for IP Addresses to pass the validation rule.
Closing since no response from the issue reporter and not actionable as well
Just realized the following
SOMEURL: Env.schema.string({format: 'url'})
if the URL is something like
http://someservice:3030
, which is the case when using an AdonisJS application with other services anddocker-compose
, it throws an error.E_INVALID_ENV_VALUE: Value for environment variable "SOMEURL" must be a valid URL, instead received "http://someservice:3030"
Expected result:
http://someservice:3030"
should be valid