-1

"after deploying asp.net core angular app on azure it will not show client side it shows swagger " public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); app.UseHsts(); }

            app.UseCors(options =>
           options.WithOrigins("http://localhost:4200")
           .AllowAnyMethod()
           .AllowAnyHeader());

            


            app.UseStaticFiles();
            app.UseDefaultFiles();




            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "CameraApp v1");
                c.RoutePrefix = string.Empty;
            });




            app.UseRouting();
            app.UseAuthentication();
            app.UseAuthorization();

            app.UseDefaultFiles();
            app.UseStaticFiles();
            

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
               
            });

1 Answers1

0

You could just redirect the index url to whatever url your angular app is hosted at:

app.UseEndpoints(endpoints => {
    ...
    endpoints.MapGet("/", (context) => {
        context.Response.Redirect("/Account/Login");
    });
});
Pieterjan
  • 2,738
  • 4
  • 28
  • 55