Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 KB | None | 0 0
  1. public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  2.         {
  3.             if (env.IsDevelopment())
  4.             {
  5.                 app.UseDeveloperExceptionPage();
  6.             }
  7.             else
  8.             {
  9.                 app.UseExceptionHandler("/Error");
  10.                 app.UseHsts();
  11.             }
  12.  
  13.             app.UseStaticFiles();
  14.             app.UseSpaStaticFiles();
  15.  
  16.             app.UseSwagger();
  17.             app.UseSwaggerUI(c =>
  18.             {
  19.                 c.SwaggerEndpoint("/swagger/v1/swagger.json", "AtlanticCORE API V1");
  20.                 c.RoutePrefix = string.Empty;
  21.                 c.DisplayRequestDuration();
  22.             });
  23.  
  24.             app.UseAuthentication();
  25.             app.UseMvc(routes =>
  26.             {
  27.                 routes.MapRoute(
  28.                     name: "default",
  29.                     template: "{controller}/{action=Index}/{id?}");
  30.             });
  31.  
  32.             app.UseSpa(spa =>
  33.             {
  34.                 spa.Options.SourcePath = "ClientApp";
  35.  
  36.                 if (env.IsDevelopment())
  37.                 {
  38.                     spa.UseAngularCliServer(npmScript: "start");
  39.                 }
  40.             });
  41.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement