This commit is contained in:
Nekura
2025-07-25 18:39:48 +02:00
commit b9d7b1c9f7
14 changed files with 1335 additions and 0 deletions

41
Startup.cs Normal file
View File

@@ -0,0 +1,41 @@
// Startup.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace FreelancerListServer
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers().AddNewtonsoftJson(); // Für JSON-Serialisierung
services.AddSingleton<LiteDbManager>();
services.AddSingleton<Logger>();
// Optional: CORS aktivieren
services.AddCors(options =>
{
options.AddPolicy("AllowAll", builder =>
{
builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader();
});
});
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseCors("AllowAll"); // Optional: CORS aktivieren
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
}
}