go-app icon indicating copy to clipboard operation
go-app copied to clipboard

run in Cloudflare workers

Open gedw99 opened this issue 1 year ago • 3 comments

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.

gedw99 avatar Jun 15 '24 04:06 gedw99

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.

oderwat avatar Jun 15 '24 12:06 oderwat

It is standard http.Handler. I don’t know how I can do better in term of compatibility.

maxence-charriere avatar Jun 15 '24 13:06 maxence-charriere