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

Move express server to react-server #796

Closed
jhnns opened this issue Jan 4, 2017 · 5 comments
Closed

Move express server to react-server #796

jhnns opened this issue Jan 4, 2017 · 5 comments

Comments

@jhnns
Copy link
Contributor

jhnns commented Jan 4, 2017

Following up #794


The actual express server is initialized inside the start module of react-server-cli. Since I don't think that the CLI should be concerned with runtime configuration, especially middleware configuration, I would move this to react-server/bin. This would nicely align with a typical express app where the actual server is placed under bin. It would also underline the separation between react-server-cli (build stuff) and react-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.

@doug-wade
Copy link
Collaborator

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.

@jhnns
Copy link
Contributor Author

jhnns commented Jan 4, 2017

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

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 react-server-express.

@roblg
Copy link
Member

roblg commented Jan 4, 2017

We could also move this to a different package, like react-server-express.

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).

@drewpc
Copy link
Collaborator

drewpc commented Jan 9, 2017

Isn't this a duplicate of #33? Maybe the name of that issue needs to be changed to something more descriptive.

@jhnns
Copy link
Contributor Author

jhnns commented Jan 10, 2017

Isn't this a duplicate of #33

Seems so, yes.

@drewpc drewpc closed this as completed Jan 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants