$ git clone <https://github.com/fly-apps/go-example>
package main

import (
    "embed"
    "html/template"
    "log"
    "net/http"
    "os"
)

//go:embed templates/*
var resources embed.FS

var t = template.Must(template.ParseFS(resources, "templates/*"))

func main() {
    port := os.Getenv("PORT")
    if port == "" {
        port = "8080"
    }

    http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
        data := map[string]string{
            "Region": os.Getenv("FLY_REGION"),
        }

        t.ExecuteTemplate(w, "index.html.tmpl", data)
    })

    log.Println("listening on", port)
    log.Fatal(http.ListenAndServe(":"+port, nil))
}
<!DOCTYPE html>
<html lang="en">
	<head>
	</head>
	<body>
		<h1>Hello from Fly</h1>
		{{ if .Region }}
		<h2>I'm running in the {{.Region}} region</h2>
		{{end}}
	</body>
</html>
$ go build