File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export default {
2121 * Handles API requests by proxying them to the backend
2222 */
2323async function handleApiRequest ( request : Request , env : Env , url : URL ) : Promise < Response > {
24- const backendUrl = 'https://laclipasa-backend.fly.dev' + url . pathname + url . search ;
24+ const backendUrl = 'https://laclipasa-backend.fly.dev' + url . pathname . replace ( '/fly-api' , '' ) + url . search ;
2525
2626 const headers = new Headers ( request . headers ) ;
2727
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ describe('Reverse Proxy Worker', () => {
7979
8080 // Check that fetch was called with the expected URL
8181 expect ( mockFetchCall ) . not . toBeNull ( ) ;
82- expect ( mockFetchCall ?. url ) . toBe ( 'https://laclipasa-backend.fly.dev/fly-api/ users' ) ;
82+ expect ( mockFetchCall ?. url ) . toBe ( 'https://laclipasa-backend.fly.dev/users' ) ;
8383 } ) ;
8484
8585 it ( 'forwards request method, headers and body' , async ( ) => {
You can’t perform that action at this time.
0 commit comments