|
|
@@ -1,7 +1,10 @@
|
|
|
using WebTemplate.ServerAspects.Auth;
|
|
|
+using WebTemplate.ServerAspects.Controllers;
|
|
|
using WebTemplate.ServerAspects.Cors;
|
|
|
+using WebTemplate.ServerAspects.Json;
|
|
|
using WebTemplate.ServerAspects.Spa;
|
|
|
using WebTemplate.ServerAspects.Swagger;
|
|
|
+using WebTemplate.Status;
|
|
|
|
|
|
namespace WebTemplate;
|
|
|
|
|
|
@@ -9,17 +12,19 @@ public class AppServer
|
|
|
{
|
|
|
private readonly IList<IAppConfigurationModule> _modules = new List<IAppConfigurationModule>
|
|
|
{
|
|
|
+ new JsonModule(),
|
|
|
new AuthModule(),
|
|
|
new CorsModule(),
|
|
|
new SpaRoutingModule(),
|
|
|
new SwaggerModule(),
|
|
|
- //new ApiControllersModule(),
|
|
|
+ new StatusEndpointModule(),
|
|
|
+ new ControllersModule(),
|
|
|
};
|
|
|
|
|
|
public void Start(string[] args)
|
|
|
{
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
- //builder.Configuration.AddJsonFile()
|
|
|
+ SetupConfiguration(builder.Configuration, builder.Environment);
|
|
|
|
|
|
foreach (var appConfigurationModule in _modules)
|
|
|
{
|
|
|
@@ -36,4 +41,9 @@ public class AppServer
|
|
|
|
|
|
app.Run();
|
|
|
}
|
|
|
+
|
|
|
+ private void SetupConfiguration(ConfigurationManager configuration, IWebHostEnvironment env)
|
|
|
+ {
|
|
|
+ configuration.AddJsonFile($"~/{env.ApplicationName}.json", optional: true);
|
|
|
+ }
|
|
|
}
|