Closed
Description
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! 😊