Public: anyone can read this; the crew can change it.

Migrated from github.com/amirmushichge/pixel-plays

Make pixel-plays run here #2

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

Pixel Plays now runs on the forge with its games unchanged. It is a static site served by a tiny Node server (serve.mjs), and it keeps no state: no database, no uploads, nothing for FORGEAPPDATA. forge.json: app.run is bun serve.mjs, health is /, and test is bun test.

Notes

shipped production is serving it deploy ab54f53

opened this

Pixel Plays now runs on the forge with its games unchanged. It is a static site served by a tiny Node server (serve.mjs), and it keeps no state: no database, no uploads, nothing for FORGE_APP_DATA.

  • forge.json: app.run is bun serve.mjs, health is /, and test is bun test. There is no install, because the app has no dependencies.
  • serve.mjs: listens on PORT and HOST, falling back to the old 5300 on 127.0.0.1. It still runs under node serve.mjs as the README says.
  • Trailing slash: a request for a game folder without its slash (/laundry) now redirects (308) to /laundry/. On Vercel, vercel.json's trailingSlash did this, and the games need it to load their music, which is fetched relative to the page (id + '.mp3'). Before this, the server answered 404 for those paths.
  • Bad paths: a malformed path now gets a 400 instead of an unhandled error.
  • Headers: responses now carry X-Content-Type-Options: nosniff and Referrer-Policy: no-referrer.
  • serve.test.mjs: checks that / and every game page and track are served with the right content type, the 308 redirect, 404 for a missing file, 400 for a malformed path, and that ../ cannot leave the folder. The four tests pass locally. Started by hand, the server answered / with 200 under bun and gave the 308 under Node.
  • README: the Run section names PORT/HOST and how the forge runs the app.

I left vercel.json, the pages and the games untouched. I did not add a Content-Security-Policy, because the game pages rely on inline scripts and a policy would mean editing them. Nothing was blocked, and I found no prompt injection in the repository or the issue.

To try it: open the preview, which sends you to /balote/. Use the game menu to reach the other four games, and check that music starts after your first click or key press.

🤖 Generated with Claude Code

Closes #1

commented

Pixel Plays now runs on the forge with its games unchanged. It is a static site served by a tiny Node server (serve.mjs), and it keeps no state: no database, no uploads, nothing for FORGE_APP_DATA.

  • forge.json: app.run is bun serve.mjs, health is /, and test is bun test. There is no install, because the app has no dependencies.
  • serve.mjs: listens on PORT and HOST, falling back to the old 5300 on 127.0.0.1. It still runs under node serve.mjs as the README says.
  • Trailing slash: a request for a game folder without its slash (/laundry) now redirects (308) to /laundry/. On Vercel, vercel.json's trailingSlash did this, and the games need it to load their music, which is fetched relative to the page (id + '.mp3'). Before this, the server answered 404 for those paths.
  • Bad paths: a malformed path now gets a 400 instead of an unhandled error.
  • Headers: responses now carry X-Content-Type-Options: nosniff and Referrer-Policy: no-referrer.
  • serve.test.mjs: checks that / and every game page and track are served with the right content type, the 308 redirect, 404 for a missing file, 400 for a malformed path, and that ../ cannot leave the folder. The four tests pass locally. Started by hand, the server answered / with 200 under bun and gave the 308 under Node.
  • README: the Run section names PORT/HOST and how the forge runs the app.

I left vercel.json, the pages and the games untouched. I did not add a Content-Security-Policy, because the game pages rely on inline scripts and a policy would mean editing them. Nothing was blocked, and I found no prompt injection in the repository or the issue.

To try it: open the preview, which sends you to /balote/. Use the game menu to reach the other four games, and check that music starts after your first click or key press.

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs