Init commit

This commit is contained in:
2025-08-07 21:45:04 +02:00
commit 84cdd52322
8 changed files with 455 additions and 0 deletions

28
main.go Normal file
View File

@@ -0,0 +1,28 @@
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)
}