mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 17:29:11 +00:00
Merge pull request #16 from syumai/move-env-to-cloudflare
move workers.Getenv to cloudflare.Getenv
This commit is contained in:
commit
879461790e
@ -1,4 +1,4 @@
|
|||||||
package workers
|
package cloudflare
|
||||||
|
|
||||||
import "github.com/syumai/workers/internal/jsutil"
|
import "github.com/syumai/workers/internal/jsutil"
|
||||||
|
|
3
examples/env/main.go
vendored
3
examples/env/main.go
vendored
@ -5,11 +5,12 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/syumai/workers"
|
"github.com/syumai/workers"
|
||||||
|
"github.com/syumai/workers/cloudflare"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
handler := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
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)
|
workers.Serve(handler)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user