don't look at me
This commit is contained in:
parent
e9f444e5b4
commit
cedbad8fba
56 changed files with 1111 additions and 294 deletions
41
backend/src/Program.cs
Normal file
41
backend/src/Program.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using JellyGlass.Repositories;
|
||||
using JellyGlass.Services;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
|
||||
builder.Services.AddOpenApi();
|
||||
builder.Services.AddControllers();
|
||||
|
||||
builder.Configuration.GetSection("TestingLogin");
|
||||
|
||||
string dbConnectionString;
|
||||
|
||||
if (builder.Environment.IsDevelopment())
|
||||
{
|
||||
dbConnectionString = "Data Source=JellyGlass-test.db;";
|
||||
}
|
||||
else
|
||||
{
|
||||
dbConnectionString = "Data Source./JellyGlass.db;";
|
||||
}
|
||||
|
||||
builder.Services.AddSqlite<DatabaseContext>(dbConnectionString);
|
||||
|
||||
builder.Services.AddTransient<ILibraryService, LibraryService>();
|
||||
builder.Services.AddTransient<IServerRepository, ServerRepository>();
|
||||
builder.Services.AddScoped<IServerService, ServerService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.MapOpenApi();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
Loading…
Add table
Add a link
Reference in a new issue