From 6b31160bbd54c8f16648538485b16126af3c2952 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Wed, 6 Dec 2023 21:34:39 +0100 Subject: [PATCH] fix: astro warnings --- website/src/pages/img/example-[name].png.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/website/src/pages/img/example-[name].png.js b/website/src/pages/img/example-[name].png.js index 22938e38..b058a017 100644 --- a/website/src/pages/img/example-[name].png.js +++ b/website/src/pages/img/example-[name].png.js @@ -4,7 +4,7 @@ import { evaluate } from '@strudel.cycles/transpiler'; import '../../../../test/runtime.mjs'; import * as tunes from '../../repl/tunes.mjs'; -export async function get({ params, request }) { +export async function GET({ params, request }) { const { name } = params; const tune = tunes[name]; const { pattern } = await evaluate(tune); @@ -13,10 +13,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 function getStaticPaths() { return Object.keys(tunes).map((name) => ({