mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: update SQLite connection string retrieval in Program.cs
This commit is contained in:
@@ -17,13 +17,15 @@ namespace SharpbinV3.Server
|
|||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
|
var connectionString = Environment.GetEnvironmentVariable("SQLITE_CONN")
|
||||||
|
?? builder.Configuration.GetConnectionString("Default");
|
||||||
|
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
|
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
|
||||||
builder.Services.AddOpenApi();
|
builder.Services.AddOpenApi();
|
||||||
builder.Services.AddDbContext<AppDbContext>(opt =>
|
builder.Services.AddDbContext<AppDbContext>(opt =>
|
||||||
{
|
{
|
||||||
opt.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection"));
|
opt.UseSqlite(connectionString);
|
||||||
});
|
});
|
||||||
builder.Services.AddSingleton<ICompressionService, CompressionService>();
|
builder.Services.AddSingleton<ICompressionService, CompressionService>();
|
||||||
builder.Services.AddSingleton<IHostedService, PasteCleanUpService>();
|
builder.Services.AddSingleton<IHostedService, PasteCleanUpService>();
|
||||||
|
|||||||
Reference in New Issue
Block a user