2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 16:10:59 +08:00
Files
panel/config/http.go
2024-02-17 15:34:35 +08:00

49 lines
1.1 KiB
Go

package config
import (
"github.com/goravel/framework/contracts/route"
"github.com/goravel/framework/facades"
ginfacades "github.com/goravel/gin/facades"
)
func init() {
config := facades.Config()
config.Add("http", map[string]any{
// HTTP Driver
"default": "gin",
// HTTP Drivers
"drivers": map[string]any{
"gin": map[string]any{
// Optional, default is 4096 KB
"body_limit": 1024 * 1024 * 4,
"header_limit": 20480,
"route": func() (route.Route, error) {
return ginfacades.Route("gin"), nil
},
},
},
// HTTP URL
"url": "http://localhost",
// HTTP Host
"host": "",
// HTTP Port
"port": config.Env("APP_PORT", "8888"),
// HTTP Entrance
"entrance": config.Env("APP_ENTRANCE", "/"),
// HTTPS Configuration
"tls": map[string]any{
// HTTPS Host
"host": "",
// HTTPS Port
"port": config.Env("APP_PORT", "8888"),
// SSL Certificate
"ssl": map[string]any{
// ca.pem
"cert": config.Env("APP_SSL_CERT", "/www/panel/storage/ssl.crt"),
// ca.key
"key": config.Env("APP_SSL_KEY", "/www/panel/storage/ssl.key"),
},
},
})
}