Hi, I'm hakairyuousinn (my X account).

I don't put my browser games on game portals. I publish them on this site. I copy the built game folder into /games/game-name/ and upload the site to Cloudflare. That's it. There are 14 games on the site right now.

An excerpt from the Cloudflare config file wrangler.jsonc, and the contents of the public folder, with folders like dig-it and rokuro under games/
The site config and the folder where the games live

Where it's hosted: Cloudflare Workers static assets

The site is plain HTML and CSS, served as "static assets" on Cloudflare Workers. I started on Cloudflare Pages, moved to the current setup on October 26, and deleted the Pages project.

The settings live in one file, wrangler.jsonc: which folder to publish (./public) and the custom domain. I bought the domain from Onamae.com, a Japanese registrar, and pointed its DNS at Cloudflare. With the custom domain in the config, the DNS record was created automatically on deploy.

Static assets have no free-tier cap on page views or bandwidth.

Steps for adding one game

  1. Build the game into plain files, with images and sounds loaded by relative paths (with Vite, base: './')
  2. Delete the whole public/games/game-name/ folder on the site, then copy the whole build in
  3. Add a card to the games page, and a line to the update history on the top page and to sitemap.xml
  4. Upload with npx wrangler deploy
  5. Open the live URL and check that it plays

I delete the folder first in step 2 because some files get new names on every build, like index-xxxx.js. If you only overwrite, old files keep piling up.

A check that stops the upload

On November 1, I released "Rokuro," a pottery game, and the link card on X showed no image. The page had no image set for the card. The next day I also noticed the page title was just "Rokuro," so search results didn't say what kind of game it was.

So I added a small script that checks every page before upload. If a title, description, card image, or analytics tag is missing, it stops there. It's listed under build in wrangler.jsonc, so it runs on every npx wrangler deploy and I can't forget it.

The day a game suddenly got played a lot

Rokuro got played a lot all at once on November 1, the day it came out. That day, the analytics service I was using (Cloudflare Zaraz) burned through its free 1 million events per month in a single day. The games themselves were fine, since they're static assets.

Analytics stopped, but the games stayed playable. The next day I switched to loading Google Analytics directly from the page. Since then, I don't put anything with a usage cap on the path players take.

I still don't know whether this beats putting games on portals. On your own site, getting people to find you is all on you too...

▶ Go to the games