You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
500 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. package app
  2. import (
  3. "fmt"
  4. "git.aiterp.net/lucifer/new-server/app/api"
  5. "git.aiterp.net/lucifer/new-server/app/config"
  6. "git.aiterp.net/lucifer/new-server/app/services"
  7. "github.com/gin-gonic/gin"
  8. "log"
  9. )
  10. func StartServer() {
  11. services.StartEventHandler()
  12. gin.SetMode(gin.ReleaseMode)
  13. ginny := gin.New()
  14. apiGin := ginny.Group("/api")
  15. api.DriverKinds(apiGin.Group("/driver-kinds"))
  16. api.Events(apiGin.Group("/events"))
  17. log.Fatal(ginny.Run(fmt.Sprintf("0.0.0.0:%d", config.ServerPort)))
  18. }