diff --git a/src/controller/get.ts b/src/controller/get.ts index d164c4b..b458919 100644 --- a/src/controller/get.ts +++ b/src/controller/get.ts @@ -3,7 +3,7 @@ export default async function get(env: Env, id: string, withTimestamp = false): return ( await env.DB.prepare('SELECT timestamp, message FROM log WHERE endpoint = ? ORDER BY timestamp ASC LIMIT -1 OFFSET 1').bind(id).all() ).results - .map((r) => `${new Date(r.timestamp as number).toISOString()} ${r.message}`) + .map((r) => (r.message as string).replace(/^/gm, new Date(r.timestamp as number).toISOString() + ' ')) .join('\n'); } else { return (