Add Flypaper solution skeleton with HTTP tarpit, SQLite event log and tests
This commit is contained in:
1 parent
20314268c6
commit
f9161f48e7
55 files changed
+1331
No files matched your search
@@ -0,0 +1,30 @@
|
||||
using Flypaper.Core;
|
||||
using Flypaper.Http;
|
||||
using Flypaper.Storage;
|
||||
using Flypaper.Web.Components;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.WebHost.ConfigureKestrel(options => options.AddServerHeader = false);
|
||||
|
||||
builder.Services.AddRazorComponents();
|
||||
builder.Services.AddFlypaperCore(builder.Configuration);
|
||||
builder.Services.AddFlypaperHttp(builder.Configuration);
|
||||
builder.Services.AddFlypaperStorage(builder.Configuration.GetConnectionString("Flypaper") ?? "Data Source=flypaper.db");
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseFlypaper();
|
||||
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
||||
}
|
||||
app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true);
|
||||
|
||||
app.UseAntiforgery();
|
||||
|
||||
app.MapStaticAssets();
|
||||
app.MapRazorComponents<App>();
|
||||
|
||||
app.Run();
|
||||
Reference in new issue
Block a user