Added cleanup logic.
This commit is contained in:
11
main.go
11
main.go
@@ -1,7 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fitra-backend/endpoints"
|
||||
"fitra-backend/application"
|
||||
"fitra-backend/controllers"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
@@ -9,12 +10,14 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
go application.StartCleanupRoutine()
|
||||
|
||||
r := gin.Default()
|
||||
r.LoadHTMLGlob("views/*")
|
||||
|
||||
r.GET("/", endpoints.HandleIndex)
|
||||
r.POST("/upload", endpoints.HandleFileUpload)
|
||||
r.GET("/uploads/:fileID/:filename", endpoints.HandleFileDownload)
|
||||
r.GET("/", controllers.HandleIndex)
|
||||
r.POST("/upload", controllers.HandleFileUpload)
|
||||
r.GET("/uploads/:fileID/:filename", controllers.HandleFileDownload)
|
||||
r.GET("/health", func(c *gin.Context) { c.JSON(200, gin.H{"status": "ok"}) })
|
||||
|
||||
if port := os.Getenv("PORT"); port != "" {
|
||||
|
||||
Reference in New Issue
Block a user