You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'd like to write the cleanest code possible, and I think it's pretty common to want to write something like this:
app.listen(process.env.APP_PORT);
The thing is that process.env.* variables are always strings, so I need to wrap that in Number:
app.listen(Number(process.env.APP_PORT));
Describe the solution you'd like
Maybe app.listen should accept a string for a port too just for this use case? Like it obviously should be a number ideally, but maybe accepting strings for making this cleaner and more express-compatible is worth it?
Describe alternatives you've considered
Wrapping those env variables in Number.
The text was updated successfully, but these errors were encountered:
It seems that a port as a string works just the same, in some sense the types are kind of wrong then 🤔 I think it'd like to see this minor thing changed.
Is your feature request related to a problem? Please describe.
I'd like to write the cleanest code possible, and I think it's pretty common to want to write something like this:
The thing is that process.env.* variables are always strings, so I need to wrap that in
Number
:Describe the solution you'd like
Maybe
app.listen
should accept a string for a port too just for this use case? Like it obviously should be a number ideally, but maybe accepting strings for making this cleaner and more express-compatible is worth it?Describe alternatives you've considered
Wrapping those env variables in
Number
.The text was updated successfully, but these errors were encountered: