Files
fn-serverless/main.go
2016-08-07 14:58:05 -04:00

31 lines
618 B
Go

package main
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/server"
"github.com/spf13/viper"
)
// See comments below for how to extend Functions
func main() {
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.")
}
srv := server.New(ds, c)
srv.Run()
}