File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 22import { resolve } from "node:path" ;
33
44import { log } from "srvx/log" ;
5- import { serve } from "srvx" ;
5+ import { FastResponse , serve } from "srvx" ;
66import { compileTemplate } from "./compiler.ts" ;
77import { renderToResponse } from "./render.ts" ;
88import { serveStatic } from "srvx/static" ;
@@ -28,7 +28,7 @@ serve({
2828 } catch ( error ) {
2929 console . error ( error ) ;
3030 const errMessage = String ( ( error as Error ) . stack || error ) ;
31- return new Response ( errMessage , { status : 500 } ) ;
31+ return new FastResponse ( errMessage , { status : 500 } ) ;
3232 }
3333 return renderToResponse ( htmlTemplate , {
3434 request,
@@ -40,6 +40,6 @@ serve({
4040 } ) ,
4141 ] ,
4242 fetch : ( ) => {
43- return new Response ( "Not Found" , { status : 404 } ) ;
43+ return new FastResponse ( "Not Found" , { status : 404 } ) ;
4444 } ,
4545} ) ;
Original file line number Diff line number Diff line change 44 type CookieSerializeOptions ,
55} from "cookie-es" ;
66import type { CompiledTemplate } from "./compiler.ts" ;
7+ import { FastResponse } from "srvx" ;
78
89export interface RenderOptions {
910 request ?: Request ;
@@ -34,7 +35,7 @@ export async function renderToResponse(
3435 if ( body instanceof Response ) {
3536 return body ;
3637 }
37- return new Response ( body , {
38+ return new FastResponse ( body , {
3839 status : ctx . $RESPONSE . status ,
3940 statusText : ctx . $RESPONSE . statusText ,
4041 headers : ctx . $RESPONSE . headers ,
You can’t perform that action at this time.
0 commit comments