feat: initial project setup
This commit is contained in:
21
main.go
Normal file
21
main.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
"git.workflows.cl/mcabezas/testing-go-example/internal/handlers"
|
||||
)
|
||||
|
||||
func main() {
|
||||
r := chi.NewRouter()
|
||||
r.Use(middleware.Logger)
|
||||
|
||||
bookHandler := handlers.NewBookHandler()
|
||||
r.Get("/books/{id}", bookHandler.GetBook)
|
||||
|
||||
log.Println("Servidor en http://localhost:3000")
|
||||
http.ListenAndServe(":3000", r)
|
||||
}
|
||||
Reference in New Issue
Block a user