main.go 712 B

123456789101112131415161718192021222324252627282930
  1. package main
  2. import (
  3. "byom-infra-api/config"
  4. "byom-infra-api/routes"
  5. "log"
  6. "net/http"
  7. "github.com/gorilla/mux"
  8. )
  9. func main() {
  10. // Initialize the OVH client configuration for API interactions
  11. config.InitOVHClient()
  12. // Create a new Gorilla Mux router instance for handling HTTP requests
  13. r := mux.NewRouter()
  14. // Configure all application routes and their handlers
  15. routes.SetupRoutes(r)
  16. log.Println("Routes configured...")
  17. // Start the HTTP server on port 8080
  18. // Log server startup message
  19. log.Println("Server starting on port 8080...")
  20. // Listen and serve HTTP requests, log fatal error if server fails to start
  21. if err := http.ListenAndServe(":8080", r); err != nil {
  22. log.Fatal(err)
  23. }
  24. }