-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartup.cs
More file actions
32 lines (22 loc) · 688 Bytes
/
Startup.cs
File metadata and controls
32 lines (22 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using GraphQL.Server.Ui.GraphiQL;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using netCoreGraphQL.Infrastructure;
var builder = WebApplication.CreateBuilder(args);
Bootstrap.ConfigureServices(builder.Services);
builder.Services.AddControllers();
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseHttpsRedirection();
app.UseRouting();
app.UseGraphQLGraphiQL(new GraphiQLOptions
{
GraphQLEndPoint = new PathString("/api/v1")
});
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
app.Run();