Use appsettings for connection string
This commit is contained in:
@@ -9,7 +9,6 @@ namespace Solar.Api;
|
||||
|
||||
public partial class Program
|
||||
{
|
||||
// TODO add launch parameters
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
@@ -20,8 +19,7 @@ public partial class Program
|
||||
// Database
|
||||
builder.Services.AddDbContext<DatabaseContext>(options =>
|
||||
{
|
||||
// TODO replace with launch argument
|
||||
options.UseSqlite("Data Source=/home/tijmen/project/home-data-collection-tools/samples/solarpaneloutput.db");
|
||||
options.UseSqlite(builder.Configuration.GetConnectionString("Database"));
|
||||
});
|
||||
|
||||
// REST infrastructure
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"Database": "Data Source=/home/tijmen/project/home-data-collection-tools/samples/solarpaneloutput.db"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"Database": "Data Source=/home/tijmen/project/home-data-collection-tools/samples/solarpaneloutput.db"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
|
||||
Reference in New Issue
Block a user