diff options
| Commit | 233f38915ba0079079233eff55434ef349c05c45 (patch) | |
|---|---|---|
| Author | 2021-04-09 19:51:35 +0300 | |
| Committer | 2021-04-09 19:51:35 +0300 | |
| Files | 6c5f69017865bcab87355e910c87339453da1406 /src/DevHive.Web/Startup.cs | |
| DevHive-main.tar DevHive-main.tar.gz DevHive-main.zip | ||
| Parent | f4a70c6430db923af9fa9958a11c2d6612cb52cc (diff) | |
| Parent | a992357efcf1bc1ece81b95ecee5e05a0b73bfdc (diff) | |
Merge pull request #28 from Team-Kaleidoscope/dev HEAD v0.2 main heroku/main
Second stage: Complete
1 files changed, 0 insertions, 70 deletions
| -rw-r--r-- | src/DevHive.Web/Startup.cs | 70 |
diff --git a/src/DevHive.Web/Startup.cs b/src/DevHive.Web/Startup.cs deleted file mode 100644 index 46521cf..0000000 --- a/src/DevHive.Web/Startup.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using DevHive.Web.Configurations.Extensions; -using Newtonsoft.Json; - -namespace DevHive.Web -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddCors(); - - services.AddControllers() - .AddNewtonsoftJson(x => - { - x.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; - }); - - services.DatabaseConfiguration(Configuration); - services.SwaggerConfiguration(); - services.JWTConfiguration(Configuration); - services.AutoMapperConfiguration(); - services.DependencyInjectionConfiguration(this.Configuration); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - app.UseCors(x => x - .AllowAnyMethod() - .AllowAnyHeader() - .SetIsOriginAllowed(origin => true) // allow any origin - .AllowCredentials()); // allow credentials - - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - app.UseSwaggerConfiguration(); - } - else - { - app.UseHsts(); - app.UseExceptionHandlerMiddlewareConfiguration(); - } - - app.UseDatabaseConfiguration(); - app.UseAutoMapperConfiguration(); - - app.UseEndpoints(endpoints => - { - endpoints.MapControllerRoute( - name: "default", - pattern: "api/{controller}/{action}" - ); - }); - } - } -} |
