From 96c2144857543ebf71299b996711eab1a3137162 Mon Sep 17 00:00:00 2001 From: Oscar Byrne Date: Wed, 17 Jan 2024 17:09:11 -0800 Subject: [PATCH] Use astro Response class for swatch/[name].png.js endpoint --- website/src/pages/swatch/[name].png.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/website/src/pages/swatch/[name].png.js b/website/src/pages/swatch/[name].png.js index 117b75a6..1906dcba 100644 --- a/website/src/pages/swatch/[name].png.js +++ b/website/src/pages/swatch/[name].png.js @@ -14,10 +14,7 @@ export async function GET({ params, request }) { const ctx = canvas.getContext('2d'); pianoroll({ time: 4, haps, ctx, playhead: 1, fold: 1, background: 'transparent', playheadColor: 'transparent' }); const buffer = canvas.toBuffer('image/png'); - return { - body: buffer, - encoding: 'binary', - }; + return new Response(buffer); } export async function getStaticPaths() { const patterns = await getMyPatterns();