main.go 678 B

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