-
Notifications
You must be signed in to change notification settings - Fork 2
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
[#85] make the port number configurable #126
[#85] make the port number configurable #126
Conversation
508c2e0
to
f901572
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about taking some default port if none of the env var and option is set?
deriving stock (Eq) | ||
|
||
instance Show RunServerException where | ||
show (RunServerIncorrectPort port) = "Port number should be greater than 0. Your port number is: " ++ show port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Port number should be from 0 to 65536 is a bit clearer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just don't check the range at all - just pass the port number to servant and let servant do the check.
@sancho20021 is no longer working on this project, so I marked his comments as resolved. I think it's good to be merged now @Kariel-Myrr 👍 |
Problem: Server boots on one hardcoded port Solution: - added opportunity to boot it on specified port - added way to set port by option or env var
Problem: now `runServer` requires port number so have to add it to tests Solution: - add env argument for port number 8081 - remove redundant .config
Problem: Add new functionality Now we can config port via: - cmd line(stronger) - environment var Solution: Write test cases for it Added two new cases - for bad str `--port` option it produce stdout output that seems unlikely - for bad `--port` < 0
Problem: New functionality - new guide Solution: Updated readme on how to boot a `coffer-server`
Problem: Optparse-applicative wrote err msg directly to stderr which messed up test results msg Solution: Use silently to mute err output
1a509cb
to
7d375cd
Compare
Description
Motivation:
Server port wasn't configurable.
We want to be able specify it via
cmd line option
orenvironment variable
Solution:
Implement configuration by
cmd option
(stronger) &env variable
for portlib
:serverOption
tests -> server-integration
Related issue(s)
Fixed #85
✅ Checklist for your Pull Request
Related changes (conditional)
Tests
silently reappearing again.
Documentation
Stylistic guide (mandatory)