프로젝트
GitHub에서 보기
syumai/workers-go
소개
Cloudflare Workers에서 HTTP 서버를 실행하는 Go 패키지입니다.
시스템 및 인프라측정된 스타 증가
- in 24h
- 0
- in 7 days
- +3
- in 15 days
- +6
- in 1 month
- +13
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalworkers-go
workers-gois a Go module to run an HTTP server written in Go on Cloudflare Workers. Its root package isworkers.- This package can easily serve http.Handler on Cloudflare Workers.
- Caution: This is an experimental project.
Documentation: https://workers-go.syumai.dev — feature support, per-platform guides, the full binding reference, and the FAQ live there.
Installation
go get github.com/syumai/workers-go
Usage
Implement your http.Handler and give it to workers.Serve().
func main() {
http.HandleFunc("/hello", func (w http.ResponseWriter, req *http.Request) { ... })
workers.Serve(nil) // if nil is given, http.DefaultServeMux is used.
}
Quick Start
- You can easily create and deploy a project from
Deploy to Cloudflarebutton.
- If you want to create a project manually, please follow the guide below.
Requirements
- Node.js (and npm)
- Go 1.24.0 or later
Create a new Worker project
npm create cloudflare@latest -- --template github.com/syumai/workers-go/_templates/cloudflare/worker-go
Initialize the project
- Navigate to your new project directory and initialize Go modules:
cd my-app
go mod init
go mod tidy
- Start the development server:
npm start
- Verify the worker is running:
curl http://localhost:8787/hello
You will see "Hello!" as the response.
Learn more
- Documentation
- Feature support — supported Workers features and their status
- Quickstart — detailed setup, including the TinyGo template
- Cloudflare — bindings for KV, R2, D1, Durable Objects, Queues, Cron, and more
- Generated bindings (
exp/cloudflare) — bindings auto-generated from@cloudflare/workers-types - Deno / Deno Deploy — run the same
http.HandlerviaDeno.serve - FAQ
_examples— a runnable project for almost every featureexp/cloudflare— experimental generated bindings and how they are produced
관련 프로젝트 살펴보기
불러오는 중…