I want to create an admin panel for my project and i used Qor admin with Gin. When i tested it on localhost it didnt cause any errors or exeptions, but when i commit it to heroku i`ll get 500 error; I use Gorm v1 as an ORM. How can i fix the error?
This is main project file is:
package main
import (
"net/http"
"os"
"github.com/gin-gonic/gin"
"github.com/qor/admin"
)
func main() {
connect()
Admin := admin.New(&admin.AdminConfig{DB: db})
adminServer := http.NewServeMux()
Admin.MountTo("/admin", adminServer)
Admin.AddResource(&User{})
app := gin.Default()
//app.LoadHTMLGlob("views/*")
app.MaxMultipartMemory = 140 << 20
gin.SetMode(gin.ReleaseMode)
Controller(app)
port := os.Getenv("PORT")
if port == "" {
port = "5000"
}
app.Any("/admin/*resources", gin.WrapH(adminServer))
app.Run(":" + port)
}
And what i get as a result when i try to open AP: And what i get as a result when i try to open AP: