package server

import (
	"fmt"
	"os"

	"github.com/gin-gonic/gin"
)

func setupBaseRoutes(r *gin.Engine) {
	r.GET("/health", func(c *gin.Context) {
		c.Status(200)
	})

	port := os.Getenv("PORT")
	if port == "" {
		port = "8080"
	}

	fmt.Printf("Server starting on port %s...\n", port)

	r.Use(func(c *gin.Context) {
		fmt.Printf("Request from: %s | Path: %s\n", c.ClientIP(), c.Request.URL.Path)
		c.Next()
	})
}