Esempio n. 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, LibraryDbContext dbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseCors(builder => builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod());
            }

            //GraphQL
            app.UseWebSockets();
            app.UseGraphQLWebSockets <LibrarySchema>("/graphql");

            app.UseGraphQL <LibrarySchema>();                         //GraphQL middlewaru
            app.UseGraphQLPlayground(new GraphQLPlaygroundOptions()); //middleware pre GraphQL playground

            dbContext.Seed();
        }