跳到正文

workers-go

热门趋势活跃
syumai/workers-go

在 Cloudflare Workers 上运行 Go 编写的 HTTP 服务器的 Go 模块——通过 workers.Serve() 即可托管任意 http.Handler。

在 GitHub 查看
星标
1188
Fork
85
关注
1188
未关闭 Issue
29

该介绍目前仅提供英文版本。

Overview

workers-go is a Go module (root package workers) for running an HTTP server written in Go on Cloudflare Workers. It serves any standard http.Handler. The project describes itself as experimental.

Installation

go get github.com/syumai/workers-go

Usage

func main() {
	http.HandleFunc("/hello", func(w http.ResponseWriter, req *http.Request) { /* ... */ })
	workers.Serve(nil) // nil serves http.DefaultServeMux
}

Quick start

Requires Node.js and Go 1.24 or later. Create a project from the template with:

npm create cloudflare@latest -- --template github.com/syumai/workers-go/_templates/cloudflare/worker-go

or use the Deploy to Cloudflare button. The documentation covers feature support, platform guides and the full binding reference.

按共同分类和标签排序的同类开源项目。

全部 SDK 项目 →