diff --git a/config/route.go b/config/route.go new file mode 100644 index 0000000..392adfd --- /dev/null +++ b/config/route.go @@ -0,0 +1,25 @@ +package config + +import ( + "github.com/goravel/framework/facades" +) + +func init() { + config := facades.Config + config.Add("route", map[string]any{ + // HTTP Host + "host": config.Env("APP_HOST", "127.0.0.1:3000"), + // HTTPS Configuration + "tls": map[string]any{ + // HTTPS Host + "host": config.Env("APP_HOST", "127.0.0.1:3000"), + // SSL Certificate + "ssl": map[string]any{ + // ca.pem + "cert": "", + // ca.key + "key": "", + }, + }, + }) +} diff --git a/main.go b/main.go index dece151..e7399e2 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ func main() { // Start http server by facades.Route. go func() { - if err := facades.Route.Run(facades.Config.GetString("app.host")); err != nil { + if err := facades.Route.Run(); err != nil { facades.Log.Errorf("Route run error: %v", err) } }()