@@ -264,7 +264,16 @@ export class MSWPlugin implements Plugin {
264264 this . handlers = [
265265 // Discovery endpoint
266266 http . get ( `${ baseUrl } ` , async ( ) => {
267- return HttpResponse . json ( await protocol . getDiscovery ( { } ) ) ;
267+ const discovery = await protocol . getDiscovery ( { } ) ;
268+ return HttpResponse . json ( {
269+ ...discovery ,
270+ routes : {
271+ data : `${ baseUrl } /data` ,
272+ metadata : `${ baseUrl } /meta` ,
273+ ui : `${ baseUrl } /ui` ,
274+ auth : `${ baseUrl } /auth`
275+ }
276+ } ) ;
268277 } ) ,
269278
270279 // Meta endpoints
@@ -300,7 +309,10 @@ export class MSWPlugin implements Plugin {
300309 params . object as string ,
301310 queryParams
302311 ) ;
303- return HttpResponse . json ( result . data , { status : result . status } ) ;
312+ return HttpResponse . json ( result . data , {
313+ status : result . status ,
314+ headers : { 'Cache-Control' : 'no-store' }
315+ } ) ;
304316 } catch ( error ) {
305317 const message = error instanceof Error ? error . message : 'Unknown error' ;
306318 return HttpResponse . json ( { error : message } , { status : 404 } ) ;
@@ -313,7 +325,10 @@ export class MSWPlugin implements Plugin {
313325 params . object as string ,
314326 params . id as string
315327 ) ;
316- return HttpResponse . json ( result . data , { status : result . status } ) ;
328+ return HttpResponse . json ( result . data , {
329+ status : result . status ,
330+ headers : { 'Cache-Control' : 'no-store' }
331+ } ) ;
317332 } catch ( error ) {
318333 const message = error instanceof Error ? error . message : 'Unknown error' ;
319334 return HttpResponse . json ( { error : message } , { status : 404 } ) ;
0 commit comments