main.go 660 B

123456789101112131415161718192021222324252627282930313233343536
  1. package main
  2. import (
  3. "log"
  4. "time"
  5. _ "github.com/lib/pq"
  6. "git.dmitriygnatenko.ru/dima/homethings/internal/fiber"
  7. sp "git.dmitriygnatenko.ru/dima/homethings/internal/service_provider"
  8. )
  9. // @title Homethings API
  10. // @version 1.0
  11. // @securitydefinitions.apikey APIKey
  12. // @in header
  13. // @name Authorization
  14. func main() {
  15. serviceProvider, err := sp.Init()
  16. if err != nil {
  17. log.Fatal(err)
  18. }
  19. fiberApp, err := fiber.Init(serviceProvider)
  20. if err != nil {
  21. log.Fatal(err)
  22. }
  23. if err = fiberApp.Listen(":" + serviceProvider.GetEnvService().GetAppPort()); err != nil {
  24. log.Fatal(err)
  25. }
  26. }
  27. func init() {
  28. time.Local = time.UTC
  29. }