Added support for hooks to customize behavior.

This commit is contained in:
Travis Reeder
2016-08-09 22:34:28 -07:00
parent 72a6d3aa5b
commit 8558d13f07
23 changed files with 324 additions and 42 deletions

View File

@@ -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)
}