-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Support --host
for Node adapter preview
#6928
Conversation
🦋 Changeset detectedLatest commit: 982a478 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
I don't think this is the right fix, otherwise this PR makes |
https://github.com/wulinsheng123/astro/blob/2a33667e94ba60dd40322ad468762743dc001c15/packages/integrations/node/src/http-server.ts#L17 So I even pass a network address I wanted to do like Vite https://github.com/vitejs/vite/blob/447df7cba987b30e3621076a74e2227f8232f64a/packages/vite/src/node/utils.ts#L803 |
Sorry for the late reply. When I log before here with
nodejs also documented it here so I'm not sure why it isn't working. But either way I think we should still leave Maybe we can re-implement how Vite does it here? |
actually, I simulate the code of Vite.
|
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.
These code changes look alright to me, but I'm not familiar enough with Node's networking logic to know for sure if this is the correct approach.
Would love @bluwy to re-review!
707d80b
to
36c5ab3
Compare
--host
for Node adapter preview
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.
Cleaned up the formatting, LGTM!
astro preview "--host" is not working |
* supporting a network address access a website when an user set host = true in Node environment * fix bug * sumbit test code * optimism * delect white space * test * fix test * fix test error * test * test * test * fix test error * Optimizing code based on the comments * optimize test * fix: rebase issues * chore: format * chore: add changeset * chore: format * chore: format * chore: lint --------- Co-authored-by: wuls <[email protected]> Co-authored-by: Nate Moore <[email protected]>
* supporting a network address access a website when an user set host = true in Node environment * fix bug * sumbit test code * optimism * delect white space * test * fix test * fix test error * test * test * test * fix test error * Optimizing code based on the comments * optimize test * fix: rebase issues * chore: format * chore: add changeset * chore: format * chore: format * chore: lint --------- Co-authored-by: wuls <[email protected]> Co-authored-by: Nate Moore <[email protected]>
Changes
--host
flag and/or respectsserver.host
setting when usingastro preview
Testing
Tested manually
Docs
Bug fix! We already say that the
server.host
setting changesastro dev
andastro preview
behavior.