Skip to content

feat: improve host option #3112

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

Merged
merged 3 commits into from
Mar 29, 2021
Merged

feat: improve host option #3112

merged 3 commits into from
Mar 29, 2021

Conversation

snitin315
Copy link
Member

@snitin315 snitin315 commented Mar 26, 2021

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

Yes

Motivation / Use-Case

Improve host option by merging with use-local-ip.

Now host option can accept - local-ip, local-ipv4, local-ipv6.

Breaking Changes

useLocalIp option was removed.

Additional Info

@codecov
Copy link

codecov bot commented Mar 26, 2021

Codecov Report

Merging #3112 (6773c30) into master (d96af16) will decrease coverage by 0.28%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3112      +/-   ##
==========================================
- Coverage   92.16%   91.87%   -0.29%     
==========================================
  Files          37       37              
  Lines        1289     1293       +4     
  Branches      345      349       +4     
==========================================
  Hits         1188     1188              
- Misses         96       98       +2     
- Partials        5        7       +2     
Impacted Files Coverage Δ
lib/Server.js 93.82% <63.63%> (-0.75%) ⬇️
lib/utils/createDomain.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d96af16...6773c30. Read the comment docs.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need some improve

@alexander-akait
Copy link
Member

Also need rebase

@snitin315 snitin315 force-pushed the use-local-ip branch 5 times, most recently from 31301a2 to 12a92fa Compare March 27, 2021 11:33
@snitin315 snitin315 marked this pull request as ready for review March 27, 2021 11:48
@alexander-akait
Copy link
Member

Small improvements here, I was wrong about handling error, let's keep as is, because Node.js output the same message

@alexander-akait alexander-akait merged commit bfec4d2 into master Mar 29, 2021
@alexander-akait alexander-akait deleted the use-local-ip branch March 29, 2021 13:44
this.hostname = hostname;
if (hostname === 'local-ip') {
this.hostname =
internalIp.v4.sync() || '0.0.0.0' || internalIp.v6.sync() || '::';
Copy link
Contributor

@ylemkimon ylemkimon Mar 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be a dead code, since '0.0.0.0' can be never false?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yep, we need change it to internalIp.v4.sync() || internalIp.v6.sync() || '0.0.0.0'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to send a fix

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed here #3128

@anshumanv anshumanv mentioned this pull request Mar 29, 2021
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants