main.go 659 B

1234567891011121314151617181920212223242526272829303132333435
  1. package main
  2. import (
  3. "log"
  4. "time"
  5. "git.dmitriygnatenko.ru/dima/homethings/internal/fiber"
  6. sp "git.dmitriygnatenko.ru/dima/homethings/internal/service_provider"
  7. _ "github.com/lib/pq"
  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. }