-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
accept host and port as envvars #25
Comments
This is basically upgrading the examples, right? This is already supported by the library. |
ah i was thinking we could bake it in, but that's probably not necessary (like include dotenv and stuff). i'm gonna leave this open cuz it might be nice, but it's not urgent. we might add defaults? i was thinking something like host and port are optional and they default to:
|
So, the trick there is that Rust doesn't have default arguments, so you'd have to make a second method that had no arguments and used the vars by default. We could change it to something like this too: let mut server = Server::new();
server.set_host("0.0.0.0");
server.set_port("7878");
server.listen(); And then if you wanted to use the fallback, you could not call |
ah yeah this seems like a nice idea |
I would argue that using 0.0.0.0 as default is not as safe as using 127.0.0.1. |
@jonashagstedt yeah I always forget which one is the good one and which one isn't; we should default to the good one. |
No description provided.
The text was updated successfully, but these errors were encountered: