pechka-fullstack-setup/Keroosha.Pechka.Web/Program.cs
2023-07-02 18:47:51 +03:00

40 lines
1.1 KiB
C#

// See https://aka.ms/new-console-template for more information
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Pechka.AspNet;
void ConfigureOptions(IConfiguration configuration, IServiceCollection services)
{
services.AddSingleton(new PechkaConfiguration()
{
// TypescriptGenerationOptions = (b) => b.DtoClassNamingPolicy = t => t == typeof(Result<>) ? "ResultT" : t.Name,
WebAppRoot = "Frontend",
WebAppApiPath = "src/api.ts",
WebAppBuildPath = "build"
});
}
void ConfigureManagers(IServiceCollection services)
{
services.AddHttpClient();
}
void ConfigureServices(IConfiguration configuration, IServiceCollection services)
{
ConfigureOptions(configuration, services);
ConfigureManagers(services);
}
void Configure(WebHostBuilderContext context, IApplicationBuilder app)
{
}
return PechkaProgramBuilder<Program>
.Create(args)
.ConfigureServices(ConfigureServices)
.ConfigureApp(Configure)
.Run();