mirror of
https://github.com/stashapp/stash.git
synced 2026-01-14 12:15:22 +01:00
* Use vendor code for all go calls * Add missing vendor dependencies * Add travis_retry to yarn install * Fix go test call
20 lines
683 B
Text
20 lines
683 B
Text
{{ reserveImport "context" }}
|
|
{{ reserveImport "log" }}
|
|
{{ reserveImport "net/http" }}
|
|
{{ reserveImport "os" }}
|
|
{{ reserveImport "github.com/99designs/gqlgen/handler" }}
|
|
|
|
const defaultPort = "8080"
|
|
|
|
func main() {
|
|
port := os.Getenv("PORT")
|
|
if port == "" {
|
|
port = defaultPort
|
|
}
|
|
|
|
http.Handle("/", handler.Playground("GraphQL playground", "/query"))
|
|
http.Handle("/query", handler.GraphQL({{ lookupImport .ExecPackageName }}.NewExecutableSchema({{ lookupImport .ExecPackageName}}.Config{Resolvers: &{{ lookupImport .ResolverPackageName}}.Resolver{}})))
|
|
|
|
log.Printf("connect to http://localhost:%s/ for GraphQL playground", port)
|
|
log.Fatal(http.ListenAndServe(":" + port, nil))
|
|
}
|