MCPcopy Create free account
hub / github.com/bbachi/react-dotnet-example / Configure

Method Configure

Startup.cs:34–67  ·  view source on GitHub ↗

This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

(IApplicationBuilder app, IWebHostEnvironment env)

Source from the content-addressed store, hash-verified

32
33 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
34 public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
35 {
36 if (env.IsDevelopment())
37 {
38 app.UseDeveloperExceptionPage();
39 }
40 else
41 {
42 app.UseExceptionHandler("/Error");
43 // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
44 app.UseHsts();
45 }
46
47 app.UseHttpsRedirection();
48 app.UseStaticFiles();
49 app.UseSpaStaticFiles();
50
51 app.UseRouting();
52
53 app.UseEndpoints(endpoints =>
54 {
55 endpoints.MapControllers();
56 });
57
58 app.UseSpa(spa =>
59 {
60 spa.Options.SourcePath = "ClientApp";
61
62 if (env.IsDevelopment())
63 {
64 spa.UseReactDevelopmentServer(npmScript: "start");
65 }
66 });
67 }
68 }
69}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected