From 347751e72b138faaf5ba11f07690d5f54be529b5 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Mon, 28 Apr 2025 08:39:01 +1000 Subject: [PATCH] refactor(init): skip network request for downloading of favicon --- init/src/init.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/init/src/init.ts b/init/src/init.ts index 4db8de029f0..e6e59151e47 100644 --- a/init/src/init.ts +++ b/init/src/init.ts @@ -391,14 +391,12 @@ ${GRADIENT_CSS}`; `; await writeFile("static/logo.svg", STATIC_LOGO); - - try { - const res = await fetch("https://fresh.deno.dev/favicon.ico"); - const buf = await res.arrayBuffer(); - await writeFile("static/favicon.ico", new Uint8Array(buf)); - } catch { - // Skip this and be silent if there is a network issue. - } + await writeFile( + "static/favicon.ico", + await Deno.readFile( + new URL(import.meta.resolve("../../www/static/favicon.ico")), + ), + ); const MAIN_TS = `import { App, fsRoutes, staticFiles } from "fresh"; import { define, type State } from "./utils.ts";