script.fly.dev - copy paste some javascript into your fly site

Hello fellow fly devs!

My history with fly is: saw it on hackernews Nov 2022 and applied for a job with them. They gave me $500 credit on my account and told me to “use it for good.” I never got the job but that $500 just sat there for years.

Recently I started hosting a few sites with fly and I really like this whole x.fly.dev namespace we can choose from. So I made:

https://script.fly.dev/

Should we have a nice directory of all the cool sites devs are hosting on this domain? If you goto that link above and copy paste in the provided javascript your site will be automatically added. Open source:

If you look closely at the javascript you’ll notice it loads wasm_exec.js and then starts go = new Go(); WebAssembly.instantiateStreaming…

I’m sending cors Access-Control-Allow-Origin: * for some endpoints to make the whole system work but should be fine. Just never allow a user to login and set a cookie on this shared domain.

https://script.fly.dev/core/yoursite

^ link to grab your javacript

Took a quick look and the immediate bit of feedback is the widget is overkill and a potential security risk.

Loading in an entire webassembly module just to show what is effectively a badge is way too much. Instead it should be an image generated on the server side which can be used with the plain old img tag. e.g. <img src="https://script.fly.dev/site/example.com/badge.avif" />

oh for sure, but the idea here is to use this as the base and keep adding features. Having the entire webassembly module is definitely overkill to just show a badge but the badge is just step 1. My original goal was to build a wasm version of:

that doesn’t need php and wordpress but can let anyone with just a front end paste in some JS and have all these stripe features. Getting a working golang wasm env means, no more JS or typescript!