-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: make web application port and hostname configurable
* SAMBAL_HOST sets the hostname, defaulting to 127.0.0.1 * SAMBAL_PORT sets the port, defaulting to 8000 The default host shouldn't be set to 0.0.0.0, because serving on all interfaces by default isn't the best for security. But this makes it possible for the user to set it to 0.0.0.0, or a different port.
- Loading branch information
Showing
2 changed files
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from waitress import serve | ||
|
||
from . import app | ||
from . import app, SETTINGS | ||
|
||
serve(app, host="127.0.0.1", port=8000) | ||
serve(app, host=SETTINGS["sambal.host"], port=SETTINGS["sambal.port"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters