123456789101112131415161718192021222324252627282930313233343536373839 |
- /*
- * @description:
- * @Author: CP
- * @Date: 2020-08-23 21:32:48
- * @FilePath: \construction_management\web\main.go
- */
- package main
- import (
- "fmt"
- "go.mod/bootstrap"
- "go.mod/conf"
- "go.mod/web/middleware/identity"
- "go.mod/web/routes"
- )
- var port = 6060
- func newApp() *bootstrap.Bootstrapper {
- // 初始化应用
- app := bootstrap.New("工程建设项目系统", "纵横软件")
- app.Bootstrap()
- //, csrf.Configure
- app.Configure(identity.Configure, routes.Configure)
- return app
- }
- func main() {
- // 服务器集群的时候才需要区分这项设置
- // 比如:根据服务器的IP、名称、端口号等,或者运行的参数
- if port == 6060 {
- conf.RunningCrontabService = true
- }
- app := newApp()
- app.Listen(fmt.Sprintf(":%d", port))
- }
|