mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Added support for hooks to customize behavior.
This commit is contained in:
7
main.go
7
main.go
@@ -7,10 +7,11 @@ import (
|
||||
"github.com/iron-io/functions/api/models"
|
||||
"github.com/iron-io/functions/api/server"
|
||||
"github.com/spf13/viper"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// See comments below for how to extend Functions
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
c := &models.Config{}
|
||||
|
||||
config.InitConfig()
|
||||
@@ -20,11 +21,11 @@ func main() {
|
||||
log.WithError(err).Fatalln("Invalid config.")
|
||||
}
|
||||
|
||||
ds, err := datastore.New(viper.GetString("db"))
|
||||
ds, err := datastore.New(viper.GetString("DB"))
|
||||
if err != nil {
|
||||
log.WithError(err).Fatalln("Invalid DB url.")
|
||||
}
|
||||
|
||||
srv := server.New(ds, c)
|
||||
srv.Run()
|
||||
srv.Run(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user