mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 17:29:11 +00:00
move workers.Getenv to cloudflare.Getenv
This commit is contained in:
parent
e3348b4ccd
commit
09b132f026
@ -1,4 +1,4 @@
|
||||
package workers
|
||||
package cloudflare
|
||||
|
||||
import "github.com/syumai/workers/internal/jsutil"
|
||||
|
4
examples/env/main.go
vendored
4
examples/env/main.go
vendored
@ -4,12 +4,14 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/syumai/workers/cloudflare"
|
||||
|
||||
"github.com/syumai/workers"
|
||||
)
|
||||
|
||||
func main() {
|
||||
handler := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||
fmt.Fprintf(w, "MY_ENV: %s", workers.Getenv("MY_ENV"))
|
||||
fmt.Fprintf(w, "MY_ENV: %s", cloudflare.Getenv("MY_ENV"))
|
||||
})
|
||||
workers.Serve(handler)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user