awesome-compose/nginx-golang/backend/main.go

39 lines
582 B
Go
Raw Normal View History

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))
}