Configured for docker container
This commit is contained in:
parent
226caf4c1e
commit
8e92077490
7 changed files with 51 additions and 4 deletions
|
|
@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||
namespace JellyGlass.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
[Route("api/[controller]")]
|
||||
public class SearchController : ControllerBase
|
||||
{
|
||||
private ILogger<SearchController> _logger;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||
namespace JellyGlass.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
[Route("api/[controller]")]
|
||||
public class ServersController : ControllerBase
|
||||
{
|
||||
private ILogger<ServersController> _logger;
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,5 +1,6 @@
|
|||
using JellyGlass.Repositories;
|
||||
using JellyGlass.Services;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
|
|
@ -18,7 +19,7 @@ if (builder.Environment.IsDevelopment())
|
|||
}
|
||||
else
|
||||
{
|
||||
dbConnectionString = "Data Source./JellyGlass.db;";
|
||||
dbConnectionString = "Data Source=JellyGlass.db;";
|
||||
}
|
||||
|
||||
builder.Services.AddSqlite<DatabaseContext>(dbConnectionString);
|
||||
|
|
@ -31,6 +32,22 @@ builder.Services.AddTransient<ISearchService, SearchService>();
|
|||
|
||||
var app = builder.Build();
|
||||
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
|
||||
dbContext.Database.Migrate();
|
||||
|
||||
dbContext.Servers.Add(new JellyGlass.Models.Server()
|
||||
{
|
||||
ApiToken = "56b6f91b816540b59d03a0db53c2dc8e",
|
||||
Id = "1",
|
||||
Owner = "Riley",
|
||||
Url = "https://jellyfin.foxhawk.co.uk"
|
||||
});
|
||||
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
|
|
@ -39,5 +56,7 @@ if (app.Environment.IsDevelopment())
|
|||
|
||||
app.UseHttpsRedirection();
|
||||
app.MapControllers();
|
||||
app.UseDefaultFiles();
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.Run();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue