import { IRouter } from '../../http' ; import type { BootstrapRenderer } from './bootstrap_renderer' ; export const registerBootstrapRoute = ( { router , renderer , } ) => { router . get ( { path : '/bootstrap.js' , options : { authRequired : 'optional' , tags : [ 'api' ] , } , validate : false , } , async ( ctx , req , res ) => { const uiSettingsClient = ctx . core . uiSettings . client ; const { body , etag } = await renderer ( { uiSettingsClient , request : req } ) ; return res . ok ( { body , headers : { etag , 'content-type' : 'application/javascript' , 'cache-control' : 'must-revalidate' , } , } ) ; } ) ; } ;