Add Chi
This commit is contained in:
parent
3445466197
commit
334c007c0e
3 changed files with 24 additions and 0 deletions
2
go.mod
2
go.mod
|
|
@ -1,3 +1,5 @@
|
|||
module github.com/TheLovinator1/FeedVault
|
||||
|
||||
go 1.21.6
|
||||
|
||||
require github.com/go-chi/chi/v5 v5.0.11
|
||||
|
|
|
|||
2
go.sum
Normal file
2
go.sum
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
github.com/go-chi/chi/v5 v5.0.11 h1:BnpYbFZ3T3S1WMpD79r7R5ThWX40TaFB7L31Y8xqSwA=
|
||||
github.com/go-chi/chi/v5 v5.0.11/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
|
||||
20
main.go
Normal file
20
main.go
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue