diff --git a/ShipyardRestApi/Program.cs b/ShipyardRestApi/Program.cs new file mode 100644 index 0000000..064a01b --- /dev/null +++ b/ShipyardRestApi/Program.cs @@ -0,0 +1,45 @@ +using Microsoft.OpenApi.Models; +using ShipyardBusinessLogic; +using ShipyardContracts.BusinessLogicContracts; +using ShipyardContracts.BusinessLogicsContracts; +using ShipyardContracts.StorageContracts; +using ShipyardContracts.StoragesContracts; +using ShipyardDatabaseImplement; +using ShipyardDatabaseImplement.Implements; + +var builder = WebApplication.CreateBuilder(args); +builder.Logging.SetMinimumLevel(LogLevel.Trace); +builder.Logging.AddLog4Net("log4net.config"); +// Add services to the container. +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); + +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at +https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(c => +{ + c.SwaggerDoc("v1", new OpenApiInfo + { + Title = "ShipyardApi", + Version + = "v1" + }); +}); +var app = builder.Build(); +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", + "ShipyardRestApi v1")); +} +app.UseHttpsRedirection(); +app.UseAuthorization(); +app.MapControllers(); +app.Run(); \ No newline at end of file diff --git a/ShipyardRestApi/appsettings.Development.json b/ShipyardRestApi/appsettings.Development.json new file mode 100644 index 0000000..ff66ba6 --- /dev/null +++ b/ShipyardRestApi/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/ShipyardRestApi/appsettings.json b/ShipyardRestApi/appsettings.json new file mode 100644 index 0000000..4d56694 --- /dev/null +++ b/ShipyardRestApi/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/ShipyardRestApi/log4net.config b/ShipyardRestApi/log4net.config new file mode 100644 index 0000000..fd8339b --- /dev/null +++ b/ShipyardRestApi/log4net.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file