mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 17:29:11 +00:00
20 lines
312 B
Go
20 lines
312 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
|
|
"github.com/syumai/workers"
|
|
)
|
|
|
|
func main() {
|
|
handler := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
|
name := req.URL.Query().Get("name")
|
|
if name == "" {
|
|
name = "world"
|
|
}
|
|
fmt.Fprintf(w, "Hello, %s!", name)
|
|
})
|
|
workers.Serve(handler)
|
|
}
|