Files
dance-lessons-coach/cmd/greet/main.go
Gabriel Radureau 6365f92359 Refactor to JSON API with Chi router and interface-based design
- Add pkg/greet/api_v1.go with ApiV1Greet interface and handler
- Implement Greeter interface for dependency injection
- Return JSON responses with proper Content-Type headers
- Move greet service instantiation to server package
- Separate v1 route registration into registerApiV1Routes function
- Health endpoint at /api level, greet endpoints at /api/v1/greet
- Simplify server entrypoint by removing external dependencies
2026-04-03 13:04:33 +02:00

18 lines
211 B
Go

package main
import (
"fmt"
"os"
"DanceLessonsCoach/pkg/greet"
)
func main() {
service := greet.NewService()
name := ""
if len(os.Args) > 1 {
name = os.Args[1]
}
fmt.Println(service.Greet(name))
}