Files
fitra-backend/main.go
2025-08-07 21:45:04 +02:00

29 lines
500 B
Go

package main
import (
"fitra-backend/endpoints"
"fmt"
"os"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
r.POST("/upload", endpoints.HandleFileUpload)
r.GET("/download/:filename", endpoints.HandleFileDownload)
r.GET("/files", endpoints.ListFiles)
r.GET("/health", func(c *gin.Context) {
c.JSON(200, gin.H{"status": "ok"})
})
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
fmt.Printf("FITRA Backend starting on port %s\n", port)
r.Run(":" + port)
}