Cleaned code
This commit is contained in:
17
main.go
17
main.go
@@ -15,16 +15,13 @@ func main() {
|
||||
r.GET("/", endpoints.HandleIndex)
|
||||
r.POST("/upload", endpoints.HandleFileUpload)
|
||||
r.GET("/uploads/:fileID/:filename", endpoints.HandleFileDownload)
|
||||
|
||||
r.GET("/health", func(c *gin.Context) {
|
||||
c.JSON(200, gin.H{"status": "ok"})
|
||||
})
|
||||
r.GET("/health", func(c *gin.Context) { c.JSON(200, gin.H{"status": "ok"}) })
|
||||
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = "8080"
|
||||
if port := os.Getenv("PORT"); port != "" {
|
||||
fmt.Printf("FITRA Backend starting on port %s\n", port)
|
||||
r.Run(":" + port)
|
||||
} else {
|
||||
fmt.Println("FITRA Backend starting on port 8080")
|
||||
r.Run(":8080")
|
||||
}
|
||||
|
||||
fmt.Printf("FITRA Backend starting on port %s\n", port)
|
||||
r.Run(":" + port)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user