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

feat(v2): add support for serve command #3080

Merged
merged 6 commits into from
Jul 20, 2020

Conversation

anshulrgoyal
Copy link
Contributor

@anshulrgoyal anshulrgoyal commented Jul 20, 2020

Motivation

The easy serving of build directory. Fix #3062

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Simple Serve

image

Combining Build

image

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jul 20, 2020
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Jul 20, 2020

Deploy preview for docusaurus-2 ready!

Built with commit 7d051d4

https://deploy-preview-3080--docusaurus-2.netlify.app

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

That looks nice thanks.
I'd rather use the existing choosePort fn

Also need to add some doc :)

packages/docusaurus/src/commands/serve.ts Show resolved Hide resolved
@slorber
Copy link
Collaborator

slorber commented Jul 20, 2020

Thanks, that looks great to merge.

I think we should add more documentation for this.

For example:
https://v2.docusaurus.io/docs/deployment/
We should mention that docusaurus serve can be used to test your local build deployment, or can also be used as a self-hosting solution.

https://v2.docusaurus.io/docs/cli/#docusaurus-build
I'd like to mention on the docusaurus build command that it's possible to test the production build using docusaurus serve :)

image

I think it would be nice for discoverability to enhance this message with something like "hey, use docusaurus serve command to test your production site"

@yangshun yangshun changed the title feat(v2):add support for serve command feat(v2): add support for serve command Jul 20, 2020
@anshulrgoyal
Copy link
Contributor Author

@slorber I don't think we shouldn't add it as a self-hosting solution. It is always ideal to use a load balancer or some production-ready software to serve these resources.

@slorber
Copy link
Collaborator

slorber commented Jul 20, 2020

@slorber I don't think we shouldn't add it as a self-hosting solution. It is always ideal to use a load balancer or some production-ready software to serve these resources.

I think we should add it, and add a caution admonition to tell the user that it may not be the most performant option. Some users simply know what they are doing, and would be happy to know it's possible to self host the thing. I'm pretty sure someone at some point will run docusaurus on a raspberry pi :p

@anshulrgoyal
Copy link
Contributor Author

@slorber I don't think we shouldn't add it as a self-hosting solution. It is always ideal to use a load balancer or some production-ready software to serve these resources.

I think we should add it, and add a caution admonition to tell the user that it may not be the most performant option. Some users simply know what they are doing, and would be happy to know it's possible to self host the thing. I'm pretty sure someone at some point will run docusaurus on a raspberry pi :p

done

@slorber slorber merged commit a51a56e into facebook:master Jul 20, 2020
@slorber
Copy link
Collaborator

slorber commented Jul 20, 2020

thanks :)

@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cli: docusaurus serve
4 participants