main.go 755 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * @description:
  3. * @Author: CP
  4. * @Date: 2020-08-23 21:32:48
  5. * @FilePath: \construction_management\web\main.go
  6. */
  7. package main
  8. import (
  9. "fmt"
  10. "go.mod/bootstrap"
  11. "go.mod/web/middleware/identity"
  12. "go.mod/web/routes"
  13. )
  14. var port = 6060
  15. func newApp() *bootstrap.Bootstrapper {
  16. // 初始化应用
  17. app := bootstrap.New("工程建设项目系统", "纵横软件")
  18. app.Bootstrap()
  19. //, csrf.Configure
  20. app.Configure(identity.Configure, routes.Configure)
  21. return app
  22. }
  23. func main() {
  24. // 服务器集群的时候才需要区分这项设置
  25. // 比如:根据服务器的IP、名称、端口号等,或者运行的参数
  26. // if port == 6060 {
  27. // conf.RunningCrontabService = true
  28. // }
  29. app := newApp()
  30. app.Listen(fmt.Sprintf(":%d", port))
  31. }