[#85] make the port number configurable#126
Merged
Kariel-Myrr merged 5 commits intoAug 7, 2022
Merged
Conversation
508c2e0 to
f901572
Compare
dcastro
requested changes
Jul 21, 2022
dcastro
reviewed
Jul 23, 2022
dcastro
requested changes
Jul 25, 2022
sancho20021
reviewed
Aug 3, 2022
Contributor
sancho20021
left a comment
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
Port number should be from 0 to 65536 is a bit clearer
Member
There was a problem hiding this comment.
Or just don't check the range at all - just pass the port number to servant and let servant do the check.
Member
|
@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
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Motivation:
Server port wasn't configurable.
We want to be able specify it via
cmd line optionorenvironment variableSolution:
Implement configuration by
cmd option(stronger) &env variablefor portlib:serverOptiontests -> server-integrationRelated issue(s)
Fixed #85
✅ Checklist for your Pull Request
Related changes (conditional)
Tests
silently reappearing again.
Documentation
Stylistic guide (mandatory)