Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run in Cloudflare workers #966

Open
gedw99 opened this issue Jun 15, 2024 · 3 comments
Open

run in Cloudflare workers #966

gedw99 opened this issue Jun 15, 2024 · 3 comments

Comments

@gedw99
Copy link

gedw99 commented Jun 15, 2024

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.

@oderwat
Copy link
Contributor

oderwat commented Jun 15, 2024

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.

@maxence-charriere
Copy link
Owner

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

@gedw99
Copy link
Author

gedw99 commented Jun 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants