The application uses react-router for client side routing. It dynamically changes the URL when an event occurs i.e route change. When site is loaded with a given URL, the router figures out what components to render.
The server on the other hand serves only two static files, index.html and main.js, therefor there is no need for the kind of server-side routing that is implemented right now.
Server needs to serve static files regardless of the URL it receives, since it's the client that explicitly asks for the initial data it needs to render any given "view".
To sum it up:
Server needs to serve
- "/" for static files from web/public
- "/ws" for websocket
Whatever is going to handle "/ws" needs to take care of the logic for dispatching client requests.
Server and client should have a common "action types" that describe the payload, to determine the data that is expected in return.
The application uses react-router for client side routing. It dynamically changes the URL when an event occurs i.e route change. When site is loaded with a given URL, the router figures out what components to render.
The server on the other hand serves only two static files, index.html and main.js, therefor there is no need for the kind of server-side routing that is implemented right now.
Server needs to serve static files regardless of the URL it receives, since it's the client that explicitly asks for the initial data it needs to render any given "view".
To sum it up:
Server needs to serve
Whatever is going to handle "/ws" needs to take care of the logic for dispatching client requests.
Server and client should have a common "action types" that describe the payload, to determine the data that is expected in return.