Open gedw99 opened 5 months ago
This package can easily serve http.Handler on Cloudflare Workers.
I did not try it but as I understand it you can simply use it. Go-App implements http.Handler
with app.Handler
. Why would you need to do anything with the HTTP calls?
The worker-go template (using regular Go, not tinygo) is also available, but it requires a paid plan of Cloudflare Workers (due to the large binary size).
The main problem would be the cost I guess.
P.S.: I am not very interested in using it though. PWAs especially are not very "fast" anyway and will not really profit that much from low latency. The gain for running them depends on the backend functionality you use. We use 80% NATS only backends and the other 20% are other API services which are often proxied into private nets and could not run on Cloudflare anyway.
It is standard http.Handler. I don’t know how I can do better in term of compatibility.
Thanks for all the comments.
For Czf workers less than 1 mb WASM size to be free, so tinygo is needed :)
I will try to make an example when I get time and make a example or if it’s wanted.
https://github.com/syumai/workers has examples showing how well we can run golang on Cloudflare for free.
It been worked well for me where I want to run a golang GUI globally for fastest possible load times of the Backend workers.
go-app srverside could easily support this. It would just require that the HTTP calls are a factory pattern or something similar.