dosubot[bot] commented on issue #29501:
URL: https://github.com/apache/superset/issues/29501#issuecomment-2210748434

   <!-- Answer -->
   To get the server to recognize a new route added in the front end 
(superset-frontend) so that it works when you refresh the browser globally 
(Ctrl + R), you need to ensure that the backend server is aware of the new 
route. This typically involves configuring the server to handle the new route 
and serve the appropriate frontend application.
   
   Here is how you can do it:
   
   1. **Add the new route to the frontend routes configuration:**
   
       ```tsx
       export const routes: Routes = [
         // ... existing routes
         {
           path: '/new/route/',
           Component: NewComponent, // Replace with your new component
         },
         // ... existing routes
       ];
       ```
   
   2. **Ensure the backend recognizes the new route:**
   
       In the Flask app configuration (usually in `superset/views/core.py` or a 
similar file), add a new route to handle the new path. For example:
   
       ```python
       from flask import render_template
       from superset import app
   
       @app.route('/new/route/')
       def new_route():
           return render_template('index.html')
       ```
   
       This ensures that when the server receives a request for `/new/route/`, 
it serves the frontend application, allowing the React Router to take over and 
render the appropriate component.
   
   By following these steps, you ensure that both the frontend and backend are 
aware of the new route, and it will work correctly when you refresh the browser 
globally (Ctrl + R) 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/views/routes.tsx)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to