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