-
Notifications
You must be signed in to change notification settings - Fork 184
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
Move express server to react-server #796
Comments
I think I might be opposed to this one; at least, it is at disharmony with #547, #536 and #247. Personally, I'd prefer to allow users to have a connect/express/koa/hapi/http-server/whatever instance and register react-server as a middleware on that server. In practice, we might not be able to support everything, but it seems strange that a requirement of using react-server is that you have to have a separate api server; seems like it should at least be an option to have a single server have both your api and your front-end on it. |
Fair enough. For me it's surprising that a CLI tool hosts the actual application server. We could also move this to a different package, like |
I think I'm in favor of that approach. I also agree that having a CLI too that embeds the server in it is confusing, and I think it makes it more difficult to do other things we've discussed (e.g., have separate processes for server and client webpack builds). |
Isn't this a duplicate of #33? Maybe the name of that issue needs to be changed to something more descriptive. |
Seems so, yes. |
Following up #794
The actual express server is initialized inside the
start
module ofreact-server-cli
. Since I don't think that the CLI should be concerned with runtime configuration, especially middleware configuration, I would move this toreact-server/bin
. This would nicely align with a typical express app where the actual server is placed underbin
. It would also underline the separation betweenreact-server-cli
(build stuff) andreact-server
(runtime).If you're against this option, we should still move the actual express server into a dedicated file. This way we can easily spawn a separate process.
The text was updated successfully, but these errors were encountered: