the best ios gas tracking app
at main 11 lines 356 B view raw
1type Handler = (req: Request) => Promise<Response> | Response; 2 3export function logged(handler: Handler): Handler { 4 return async (req: Request) => { 5 const start = Date.now(); 6 const url = new URL(req.url); 7 const res = await handler(req); 8 console.log(`${req.method} ${url.pathname}${res.status} (${Date.now() - start}ms)`); 9 return res; 10 }; 11}