26 lines
395 B
Go
26 lines
395 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
"os"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func main() {
|
|
// Config simple : port via PORT, defaut 8080.
|
|
port := os.Getenv("PORT")
|
|
if port == "" {
|
|
port = "8080"
|
|
}
|
|
|
|
r := gin.Default()
|
|
|
|
// Route de sante pour verifier que le backend repond.
|
|
r.GET("/healthz", func(c *gin.Context) {
|
|
c.JSON(http.StatusOK, gin.H{"status": "ok"})
|
|
})
|
|
|
|
_ = r.Run(":" + port)
|
|
}
|