add achats import and hardware analyse
This commit is contained in:
@@ -49,6 +49,13 @@ func main() {
|
||||
}
|
||||
}()
|
||||
|
||||
// Activer WAL pour SQLite si disponible.
|
||||
if driver == "sqlite3" {
|
||||
if _, err := client.ExecContext(context.Background(), "PRAGMA journal_mode = WAL;"); err != nil {
|
||||
log.Printf("activation WAL impossible: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-creation du schema en dev. A remplacer par migrations en prod.
|
||||
if err := client.Schema.Create(context.Background()); err != nil {
|
||||
log.Fatalf("creation schema impossible: %v", err)
|
||||
@@ -56,7 +63,10 @@ func main() {
|
||||
|
||||
// Route de sante pour verifier que le backend repond.
|
||||
r.GET("/healthz", func(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"status": "ok"})
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"status": "ok",
|
||||
"version": "0.1.0",
|
||||
})
|
||||
})
|
||||
|
||||
handlers.RegisterRoutes(r, client)
|
||||
|
||||
Reference in New Issue
Block a user