Added experimental GraphQL server
This commit is contained in:
7
main.go
7
main.go
@ -4,6 +4,7 @@ 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"
|
||||
@ -12,10 +13,9 @@ import (
|
||||
"github.com/animenotifier/notify.moe/utils/routetests"
|
||||
)
|
||||
|
||||
var app = aero.New()
|
||||
|
||||
func main() {
|
||||
// Configure and start
|
||||
app := aero.New()
|
||||
configure(app).Run()
|
||||
}
|
||||
|
||||
@ -60,6 +60,9 @@ func configure(app *aero.Application) *aero.Application {
|
||||
// Authentication
|
||||
auth.Install(app)
|
||||
|
||||
// GraphQL
|
||||
app.Post("/api", graphql.Handler(arn.DB))
|
||||
|
||||
// Close the database node on shutdown
|
||||
app.OnEnd(arn.Node.Close)
|
||||
|
||||
|
Reference in New Issue
Block a user