20 lines
364 B
Go
20 lines
364 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/go-chi/chi/v5"
|
|
"github.com/go-chi/chi/v5/middleware"
|
|
)
|
|
|
|
func main() {
|
|
r := chi.NewRouter()
|
|
r.Use(middleware.Logger)
|
|
r.Get("/", func(w http.ResponseWriter, _ *http.Request) {
|
|
w.Write([]byte("welcome"))
|
|
})
|
|
|
|
log.Println("listening on http://localhost:8000/")
|
|
http.ListenAndServe("127.0.0.1:8000", r)
|
|
}
|