Skip to content

Commit

Permalink
fix: astro warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
felixroos committed Dec 6, 2023
1 parent 74aa85b commit 6b31160
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions website/src/pages/img/example-[name].png.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) => ({
Expand Down

0 comments on commit 6b31160

Please sign in to comment.