diff --git a/main.ts b/main.ts index 6ca41d1..fc785f6 100644 --- a/main.ts +++ b/main.ts @@ -6,6 +6,7 @@ const router = new oak.Router(); router.post("/api/log", async (ctx) => { const data = await ctx.request.body.json(); + console.log(`POST /api/log ${JSON.stringify(data)}`); const enc = new TextEncoder(); @@ -27,7 +28,7 @@ router.get("/api/log", async (ctx) => { .split("\n") .filter((l) => l) .map((entry) => entry.split("\t")) - .map(([timestamp, data]) => (console.log(timestamp, data), { + .map(([timestamp, data]) => ({ timestamp: new Date(timestamp), data: JSON.parse(data), }));