refactor: ♻️ Don't use Bun global

This commit is contained in:
Jesse Wierzbinski 2025-03-30 23:06:34 +02:00
parent d55668d529
commit 25ea870f71
No known key found for this signature in database
15 changed files with 32 additions and 19 deletions

View file

@ -1,4 +1,5 @@
import { getLogger } from "@logtape/logtape";
import { SHA256 } from "bun";
import chalk from "chalk";
import { createMiddleware } from "hono/factory";
import { config } from "~/config.ts";
@ -11,7 +12,7 @@ export const logger = createMiddleware(async (context, next) => {
const urlAndMethod = `${chalk.green(context.req.method)} ${chalk.blue(context.req.url)}`;
const hash = `${chalk.bold("Hash")}: ${chalk.yellow(
new Bun.SHA256().update(body).digest("hex"),
new SHA256().update(body).digest("hex"),
)}`;
const headers = `${chalk.bold("Headers")}:\n${Array.from(