mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
* Add gql client generation files * Update dependencies * Add stash-box client generation to the makefile * Move scraped scene object matchers to models * Add stash-box to scrape with dropdown * Add scrape scene from fingerprint in UI
24 lines
782 B
Plaintext
24 lines
782 B
Plaintext
{{ reserveImport "context" }}
|
|
{{ reserveImport "log" }}
|
|
{{ reserveImport "net/http" }}
|
|
{{ reserveImport "os" }}
|
|
{{ reserveImport "github.com/99designs/gqlgen/graphql/playground" }}
|
|
{{ reserveImport "github.com/99designs/gqlgen/graphql/handler" }}
|
|
|
|
const defaultPort = "8080"
|
|
|
|
func main() {
|
|
port := os.Getenv("PORT")
|
|
if port == "" {
|
|
port = defaultPort
|
|
}
|
|
|
|
srv := handler.NewDefaultServer({{ lookupImport .ExecPackageName }}.NewExecutableSchema({{ lookupImport .ExecPackageName}}.Config{Resolvers: &{{ lookupImport .ResolverPackageName}}.Resolver{}}))
|
|
|
|
http.Handle("/", playground.Handler("GraphQL playground", "/query"))
|
|
http.Handle("/query", srv)
|
|
|
|
log.Printf("connect to http://localhost:%s/ for GraphQL playground", port)
|
|
log.Fatal(http.ListenAndServe(":" + port, nil))
|
|
}
|