import type { LoaderFunction } from 'remix' ; import { getPostJson } from '~/utils/blog.server' ; export const loader = async ( { request } ) => { const data = await getPostJson ( request ) ; const string = JSON . stringify ( data ) ; return new Response ( string , { headers : { 'Content-Type' : 'application/json' , 'Content-Length' : String ( Buffer . byteLength ( string ) ) , } , } ) ; } ;