Skip to content
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

fix(docz-core): pass down host when running serve #1384

Merged
merged 1 commit into from
Feb 10, 2020

Conversation

ShinyLeee
Copy link
Contributor

Description

When I start deploy docz project in my own server, i found that server publish ip address can not be access but localhost can, and after checkout gatsby cli command, i found the problem is host is always be localhost and can not be changed to others when use docz serve.

// https://www.gatsbyjs.org/docs/cheat-sheet/#cheat_sheet-text
cliArgs.push('--port')
cliArgs.push(String(config.port))
}

if (config.host) {
Copy link
Contributor

@alexandre-lelain alexandre-lelain Feb 9, 2020

Choose a reason for hiding this comment

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

I think we should do a more generic gatsby arguments handling, so users can use all of gatsby's cli arguments.

Something like:

for (const arg in config) {
  cliArgs.push('--')
  cliArgs.push(`--${arg}`)
  cliArgs.push(String(config[arg]))
}

This code will make sure to scale automatically when gatsby are adding new cli arguments.
Also, this would probably solve #1374.

What do you think @rakannimer ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

config object now contains project config (menu, themeConfig...) other than gatsby's cli arguments.

image

If we want make it scale automatically, maybe add a gatsbyCliConfig to place these gatsby's arguments?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @alexandre-lelain, what you're saying makes sense to me, and I tried doing something like that a couple of commits ago but it resulted in some errors because of conflicts over variable names between docz config and gatsby. So while it looks redundant it might be better (for now) to explicitly pass down arguments.

Regarding #1374 it should be fixed in 2.3.0-alpha.11 but I forgot to update so thanks for the reminder !

@rakannimer
Copy link
Contributor

Thanks @ShinyLeee 👍

@rakannimer rakannimer changed the title fix(docz-core): parse host when running serve fix(docz-core): pass down host when running serve Feb 10, 2020
@rakannimer rakannimer merged commit 80a0e1e into doczjs:master Feb 10, 2020
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.

3 participants