Add a cache system on the referential info

+ Add an identity service
This commit is contained in:
Sébastien André
2021-04-17 22:17:45 +02:00
parent 0bb9ed2a30
commit 143127cd01
30 changed files with 955 additions and 570 deletions

View File

@@ -13,22 +13,48 @@ using skydiveLogs_api.Ioc;
using skydiveLogs_api.Settings;
using skydiveLogs_api.DomainBusiness.Interfaces;
namespace skydiveLogs_api
{
public class Startup
{
#region Public Constructors
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
#endregion Public Constructors
#region Public Methods
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.EnvironmentName == "Development")
{
app.UseDeveloperExceptionPage();
}
else
{
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseCors();
app.UseAuthentication();
app.UseMvc();
}
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc(options => { options.EnableEndpointRouting = false; })
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
services.AddHttpContextAccessor();
// JWT
var jwtSection = Configuration.GetSection("JWT");
services.Configure<JwtSettings>(jwtSection);
@@ -77,24 +103,9 @@ namespace skydiveLogs_api
CheckAndInitDb(services);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.EnvironmentName == "Development")
{
app.UseDeveloperExceptionPage();
}
else
{
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
#endregion Public Methods
app.UseCors();
app.UseAuthentication();
app.UseMvc();
}
#region Private Methods
private void CheckAndInitDb(IServiceCollection services)
{
@@ -109,6 +120,12 @@ namespace skydiveLogs_api
}
}
#endregion Private Methods
#region Public Properties
public IConfiguration Configuration { get; }
#endregion Public Properties
}
}
}