2024-09-05 14:23:58 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-09-30 17:38:16 +00:00
|
|
|
"git.vinchent.xyz/vinchent/go-web/app/console"
|
|
|
|
"git.vinchent.xyz/vinchent/go-web/app/web"
|
|
|
|
"git.vinchent.xyz/vinchent/go-web/framework"
|
|
|
|
"git.vinchent.xyz/vinchent/go-web/framework/providers/app"
|
|
|
|
"git.vinchent.xyz/vinchent/go-web/framework/providers/kernel"
|
2024-09-05 14:23:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2024-09-30 17:38:16 +00:00
|
|
|
container := framework.NewGoWebContainer()
|
2024-09-26 20:27:26 +00:00
|
|
|
|
2024-09-30 17:38:16 +00:00
|
|
|
container.Bind(&app.GoWebAppProvider{})
|
2024-09-26 20:27:26 +00:00
|
|
|
|
2024-09-30 17:38:16 +00:00
|
|
|
engine, err := web.NewHttpEngine()
|
|
|
|
if err != nil {
|
|
|
|
panic("Cannot start http server")
|
|
|
|
}
|
2024-09-26 20:27:26 +00:00
|
|
|
|
2024-09-30 17:38:16 +00:00
|
|
|
container.Bind(&kernel.GoWebKernelProvider{HttpEngine: engine})
|
2024-09-26 20:58:55 +00:00
|
|
|
|
2024-09-30 17:38:16 +00:00
|
|
|
console.RunCommand(container)
|
2024-09-05 14:23:58 +00:00
|
|
|
}
|