init backend and dev docs
This commit is contained in:
25
backend/cmd/app/main.go
Normal file
25
backend/cmd/app/main.go
Normal file
@@ -0,0 +1,25 @@
|
||||
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)
|
||||
}
|
||||
5
backend/go.mod
Normal file
5
backend/go.mod
Normal file
@@ -0,0 +1,5 @@
|
||||
module gitea.maison43.duckdns.org/gilles/matosbox
|
||||
|
||||
go 1.23
|
||||
|
||||
require github.com/gin-gonic/gin v1.10.0
|
||||
Reference in New Issue
Block a user