-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.go
38 lines (27 loc) · 1.13 KB
/
init.go
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
package main
import (
"github.com/bjorge/friendlyreservations/config"
"github.com/bjorge/friendlyreservations/frapi"
"github.com/bjorge/friendlyreservations/local_platform"
"github.com/bjorge/friendlyreservations/logger"
graphql "github.com/graph-gophers/graphql-go"
)
var log = logger.New()
var corsOriginURI string
var adminSchema *graphql.Schema
var memberSchema *graphql.Schema
var homeSchema *graphql.Schema
var redirectURL string
var redirectLabel string
func init() {
corsOriginURI = config.GetConfig("PLATFORM_CORS_ORIGIN_URI")
redirectURL = config.GetConfig("REDIRECT_URL")
redirectLabel = config.GetConfig("REDIRECT_LABEL")
frapi.PersistedEmailStore = localplatform.NewPersistedEmailStore()
frapi.PersistedVersionedEvents = localplatform.NewPersistedVersionedEvents()
frapi.PersistedPropertyList = localplatform.NewPersistedPropertyList()
frapi.EmailSender = localplatform.NewEmailSender()
adminSchema = graphql.MustParseSchema(frapi.AdminSchema, &frapi.Resolver{})
memberSchema = graphql.MustParseSchema(frapi.MemberSchema, &frapi.Resolver{})
homeSchema = graphql.MustParseSchema(frapi.HomeSchema, &frapi.Resolver{})
}