"Royal-Mail-shipping-integration-and-test-improvements"
This commit is contained in:
@@ -22,8 +22,16 @@ builder.Services.AddControllers();
|
||||
builder.Services.AddControllersWithViews(); // Add MVC for Admin Panel
|
||||
|
||||
// Database
|
||||
builder.Services.AddDbContext<LittleShopContext>(options =>
|
||||
options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection")));
|
||||
if (builder.Environment.EnvironmentName == "Testing")
|
||||
{
|
||||
builder.Services.AddDbContext<LittleShopContext>(options =>
|
||||
options.UseInMemoryDatabase("InMemoryDbForTesting"));
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.Services.AddDbContext<LittleShopContext>(options =>
|
||||
options.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection")));
|
||||
}
|
||||
|
||||
// Authentication - Cookie for Admin Panel, JWT for API
|
||||
var jwtKey = builder.Configuration["Jwt:Key"] ?? "YourSuperSecretKeyThatIsAtLeast32CharactersLong!";
|
||||
@@ -67,6 +75,8 @@ builder.Services.AddScoped<IOrderService, OrderService>();
|
||||
builder.Services.AddScoped<ICryptoPaymentService, CryptoPaymentService>();
|
||||
builder.Services.AddScoped<IBTCPayServerService, BTCPayServerService>();
|
||||
builder.Services.AddScoped<IShippingRateService, ShippingRateService>();
|
||||
builder.Services.AddScoped<IRoyalMailService, RoyalMailShippingService>();
|
||||
builder.Services.AddHttpClient<IRoyalMailService, RoyalMailShippingService>();
|
||||
builder.Services.AddScoped<IDataSeederService, DataSeederService>();
|
||||
builder.Services.AddScoped<IBotService, BotService>();
|
||||
builder.Services.AddScoped<IBotMetricsService, BotMetricsService>();
|
||||
|
||||
Reference in New Issue
Block a user