fix: astro warnings
This commit is contained in:
parent
74aa85b38b
commit
6b31160bbd
1 changed files with 2 additions and 5 deletions
|
|
@ -4,7 +4,7 @@ import { evaluate } from '@strudel.cycles/transpiler';
|
||||||
import '../../../../test/runtime.mjs';
|
import '../../../../test/runtime.mjs';
|
||||||
import * as tunes from '../../repl/tunes.mjs';
|
import * as tunes from '../../repl/tunes.mjs';
|
||||||
|
|
||||||
export async function get({ params, request }) {
|
export async function GET({ params, request }) {
|
||||||
const { name } = params;
|
const { name } = params;
|
||||||
const tune = tunes[name];
|
const tune = tunes[name];
|
||||||
const { pattern } = await evaluate(tune);
|
const { pattern } = await evaluate(tune);
|
||||||
|
|
@ -13,10 +13,7 @@ export async function get({ params, request }) {
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
pianoroll({ time: 4, haps, ctx, playhead: 1, fold: 1, background: 'transparent', playheadColor: 'transparent' });
|
pianoroll({ time: 4, haps, ctx, playhead: 1, fold: 1, background: 'transparent', playheadColor: 'transparent' });
|
||||||
const buffer = canvas.toBuffer('image/png');
|
const buffer = canvas.toBuffer('image/png');
|
||||||
return {
|
return new Response(buffer);
|
||||||
body: buffer,
|
|
||||||
encoding: 'binary',
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
export function getStaticPaths() {
|
export function getStaticPaths() {
|
||||||
return Object.keys(tunes).map((name) => ({
|
return Object.keys(tunes).map((name) => ({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue