Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Consistency & documentation of which URLs are used #246

Closed
lacker opened this issue Jul 27, 2016 · 3 comments · May be fixed by marcusrc/create-react-app#1
Closed

Consistency & documentation of which URLs are used #246

lacker opened this issue Jul 27, 2016 · 3 comments · May be fixed by marcusrc/create-react-app#1

Comments

@lacker
Copy link
Contributor

lacker commented Jul 27, 2016

We should document and stick to some pattern for what URLs are used, in both the development server and a production deploy.

The rationale is, if you are setting up a proxy, you might want to route a certain path to a different server. You need to choose a path that isn't used by this React app, which means you have to know what paths are used. If you route /files/* to a different port, and later we switch the build script so that it generates files prefixed with /files/, your setup will break.

My suggestion is, in production only use the URL patterns / and /static/*. In the dev server, use those two but also /dev/* for non-static content - ie the websocket. Then any routing layer only has a few things to worry about.

@gaearon
Copy link
Contributor

gaearon commented Jul 27, 2016

cc @ForbesLindesay who also wanted this

@gaearon
Copy link
Contributor

gaearon commented Jul 29, 2016

#278 gives us /static

@gaearon
Copy link
Contributor

gaearon commented Sep 3, 2016

We consistently use /static for any assets, and we serve index.html or proxy fallback for any other URL depending on whether you have proxy and whether accept header contains text/html. Seems pretty consistent to me.

@gaearon gaearon closed this as completed Sep 3, 2016
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants