mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
remove unnecessary config
This commit is contained in:
9
main.go
9
main.go
@@ -4,7 +4,6 @@ import (
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/iron-io/functions/api/config"
|
||||
"github.com/iron-io/functions/api/datastore"
|
||||
"github.com/iron-io/functions/api/models"
|
||||
"github.com/iron-io/functions/api/runner"
|
||||
"github.com/iron-io/functions/api/server"
|
||||
"github.com/spf13/viper"
|
||||
@@ -13,15 +12,9 @@ import (
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
c := &models.Config{}
|
||||
|
||||
config.InitConfig()
|
||||
|
||||
err := c.Validate()
|
||||
if err != nil {
|
||||
log.WithError(err).Fatalln("Invalid config.")
|
||||
}
|
||||
|
||||
ds, err := datastore.New(viper.GetString("DB"))
|
||||
if err != nil {
|
||||
log.WithError(err).Fatalln("Invalid DB url.")
|
||||
@@ -32,6 +25,6 @@ func main() {
|
||||
log.WithError(err).Fatalln("Failed to create a runner")
|
||||
}
|
||||
|
||||
srv := server.New(c, ds, runner)
|
||||
srv := server.New(ds, runner)
|
||||
srv.Run(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user