madeagency / reactivity

A Bleeding Edge React Universal Boilerplate for Power Users.
MIT License
79 stars 12 forks source link

Multiple routes #82

Closed nobleach closed 6 years ago

nobleach commented 6 years ago

This appears to be locked in to one universal route (in Express) All traffic flows through render.js What if one wanted to do multiple routes? (not using React router) I'm considering pulling it all apart and playing with it. My app would have to do some configuration on startup - instead of doing all the work on req/res. I just didn't know if you might have some immediate thoughts.

rocbear commented 6 years ago

@nobleach I'm not sure I fully understand your question but I'll try and point you in the right direction. render.js is compiled to build/server.js which is used as middleware in the express app defined in src/server/index.js. You can see this happening in bin/server.prod.js.

In short, if you'd like to add routes at the express level, the best place to do it would probably be src/server/index.js.

Hope this helps!

nobleach commented 6 years ago

I'm sorry, I communicated it poorly. You answered my question however. I was expecting some sort of app.use() to declare the middleware explicitly. I do see it in the server.prod.

rocbear commented 6 years ago

No problem, glad I could help clear things up.