42f6713231
* Add Docker Desktop Developer Environments config
* Upgrade from Go 1.13 (🙀) to 1.18
* Rename `frontend` -> `proxy` for clarity & consistency
with other samples
* Add Chi as a dependency to provide an example of Go
module dependencies for parity with other samples
Signed-off-by: Milas Bowman <milas.bowman@docker.com>
39 lines
582 B
Go
39 lines
582 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/go-chi/chi/v5"
|
|
"github.com/go-chi/chi/v5/middleware"
|
|
)
|
|
|
|
func handler(w http.ResponseWriter, r *http.Request) {
|
|
fmt.Fprintf(
|
|
w, `
|
|
## .
|
|
## ## ## ==
|
|
## ## ## ## ## ===
|
|
/"""""""""""""""""\___/ ===
|
|
{ / ===-
|
|
\______ O __/
|
|
\ \ __/
|
|
\____\_______/
|
|
|
|
|
|
Hello from Docker!
|
|
|
|
`,
|
|
)
|
|
}
|
|
|
|
func main() {
|
|
r := chi.NewRouter()
|
|
r.Use(middleware.Logger)
|
|
r.Get("/", handler)
|
|
|
|
fmt.Println("Go backend started!")
|
|
log.Fatal(http.ListenAndServe(":80", r))
|
|
}
|