Merge pull request #16 from syumai/move-env-to-cloudflare

move workers.Getenv to cloudflare.Getenv
This commit is contained in:
syumai 2022-11-19 23:12:13 +09:00 committed by GitHub
commit 879461790e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
package workers
package cloudflare
import "github.com/syumai/workers/internal/jsutil"

View File

@ -5,11 +5,12 @@ import (
"net/http"
"github.com/syumai/workers"
"github.com/syumai/workers/cloudflare"
)
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)
}