Skip to content

Commit

Permalink
Documentación
Browse files Browse the repository at this point in the history
  • Loading branch information
markalbrand56 committed Nov 17, 2023
1 parent 2f67f20 commit e66cdfe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (
)

func main() {
// create directory for uploads
// create directory for profile pictures
if _, err := configs.CreateDirIfNotExist("./uploads"); err != nil {
panic(err)
}

// create directory for pdf files
if _, err := configs.CreateDirIfNotExist("./uploads/pdf"); err != nil {
panic(err)
}
Expand All @@ -23,9 +24,13 @@ func main() {
routes.Routes(router)
configs.SetupDB()

router.Run(":8080")
err := router.Run(":8080")
if err != nil {
return
}
}

// CORS permite el acceso a la API desde cualquier origen
func CORS() gin.HandlerFunc {
// Reference: https://github.com/gin-contrib/cors/issues/29
return func(c *gin.Context) {
Expand Down

0 comments on commit e66cdfe

Please sign in to comment.