-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
46 lines (35 loc) · 751 Bytes
/
main.go
File metadata and controls
46 lines (35 loc) · 751 Bytes
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
package main
import (
"strings"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
app "github.com/BrobridgeOrg/vibration-api-service/app"
)
func init() {
// From the environment
viper.SetEnvPrefix("VIBRATION_API_SERVICE")
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.AutomaticEnv()
// From config file
viper.SetConfigName("config")
viper.AddConfigPath("./")
viper.AddConfigPath("./config")
if err := viper.ReadInConfig(); err != nil {
log.Warn("No configuration file was loaded")
}
}
func main() {
// Initializing application
a := app.CreateApp()
err := a.Init()
if err != nil {
log.Fatal(err)
return
}
// Starting application
err = a.Run()
if err != nil {
log.Fatal(err)
return
}
}