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

Suggest serve for running in production #1757

Closed
leo opened this issue Mar 7, 2017 · 2 comments · Fixed by #1760
Closed

Suggest serve for running in production #1757

leo opened this issue Mar 7, 2017 · 2 comments · Fixed by #1760

Comments

@leo
Copy link
Contributor

leo commented Mar 7, 2017

I noticed that you're handling production in a pretty complicated way. You're basically telling people to either use Python on the prod platform or set up a programmatic server using express (here).

Why? All of this could be solved easier:

npm install --save serve

And then this command would sit in a script property of your choice inside package.json:

serve -s ./build

By default, serve is just a beautiful, tiny (and fast as hell) webserver for static files and sites. But in combination with the -s or --single flag, it will handle all of the logic required for making single page applications work (in terms of routing).

I would even suggest shipping serve by default as a dependency (like you're doing it with react-scripts and react).

Let me know what you think! 😊

@gaearon
Copy link
Contributor

gaearon commented Mar 7, 2017

One of the reasons is I want to show that this is Node-agnostic, and that they can integrate it into existing apps (which likely aren’t static). We also have a build message that suggest using pushstate-server to test their changes.

I wouldn’t mind switching recommendation to serve if it satisfies our use cases better. For the docs, I’m open to adding it as another (simpler) option, and rephrasing others as explanation that you don’t have to use Node, and you don’t have to use a static-only server either.

@leo
Copy link
Contributor Author

leo commented Mar 8, 2017

Sounds great, @gaearon! Created a PR for what you've suggested.

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants