-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
55 lines (45 loc) · 1.11 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package main
import (
"fmt"
"log"
"os"
"time"
bootstrap "hiringo/bootstrap"
"github.com/joho/godotenv"
"github.com/labstack/echo/v4"
)
// @title Hiringo API
// @version 1.0
// @description Hiringo API Service.
// @host main-api.hiringo.tech
// @BasePath /
// @contact.name Emin Muhammadi
// @contact.url https://github.com/softech-craftsman-webapp/hiringo
// @contact.email admin@hiringo.tech
// @securityDefinitions.apiKey JWT
// @in header
// @name Authorization
func main() {
// Load .env file
err := godotenv.Load(".env")
if err != nil {
fmt.Println(".env file is not imported, in production kindly ignore this message")
}
// Set timezone globally
if tz := os.Getenv("TZ"); tz != "" {
var err error
time.Local, err = time.LoadLocation(tz)
if err != nil {
log.Printf("error loading location '%s': %v\n", tz, err)
}
}
/*
|--------------------------------------------------------------------------
| Start Server
|--------------------------------------------------------------------------
*/
app := echo.New()
port := os.Getenv("PORT")
// Application
bootstrap.Start(app, port)
}