Implemented aero GraphQL server

This commit is contained in:
2019-05-11 16:03:37 +09:00
parent 751d10448e
commit a48e053de4
4 changed files with 103 additions and 5 deletions

View File

@ -4,10 +4,10 @@ import (
"strings"
"github.com/aerogo/aero"
"github.com/aerogo/graphql"
nanostore "github.com/aerogo/session-store-nano"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/auth"
"github.com/animenotifier/notify.moe/graphql"
"github.com/animenotifier/notify.moe/middleware"
"github.com/animenotifier/notify.moe/pages"
"github.com/animenotifier/notify.moe/utils/routetests"
@ -61,7 +61,7 @@ func configure(app *aero.Application) *aero.Application {
auth.Install(app)
// GraphQL
app.Post("/graphql", graphql.Handler(arn.DB))
graphql.Install(app)
// Close the database node on shutdown
app.OnEnd(arn.Node.Close)