This commit is contained in:
Joakim Hellsén 2024-02-03 02:29:29 +01:00
commit 334c007c0e
3 changed files with 24 additions and 0 deletions

20
main.go Normal file
View file

@ -0,0 +1,20 @@
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)
}