Skip to content

Commit

Permalink
Update [name].js
Browse files Browse the repository at this point in the history
  • Loading branch information
leomcelroy committed Jul 20, 2022
1 parent 9c46d1e commit c4ec2aa
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions api/thumbnail/[name].js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import * as gridEngine from "../../engine/engine.js";
import { palette } from "../../palette.js";
import fetch from 'node-fetch';
// import fetch from 'node-fetch';
import { readFileSync } from 'fs';
// import path from 'path';

async function drawGame(game) {

const url = `https://raw.githubusercontent.com/hackclub/sprig/main/games/${game}.js`;
const src = await fetch(url).then(x => x.text());
// const url = `https://raw.githubusercontent.com/hackclub/sprig/main/games/${game}.js`;
// const src = await fetch(url).then(x => x.text());

const src = readFileSync(`../../games/${game}.js`, 'utf8');

let screen, bitmaps;
const setScreenSize = (w, h) => screen = new ImageData(w, h);
Expand Down

0 comments on commit c4ec2aa

Please sign in to comment.