We are building a web app(asp.net core + angular) and we have some settings(like email server+username, mongoDb connection string, ...) that are required for the application to work properly.
The web app will be only an intranet app, and will be deployed by the customers on multiple location.
We wish that we could have a wizard when starting the web app(a bit like all those good old PHP website(wordpress like)), that would initialize the server configuration.
So my question: Is it possible, from a API call, to set some configuration(that will be persistent)? A bit like settings a config file to be reused?
EDIT
With the help of @ParsaS, I managed to edit the appsettings.json
, but in my program.cs, I get most of what is using my configuration, that doesn't reload those settings:
MongoDbSettings dbSettings = configuration.GetSection(MongoDbSettings.SECTION_NAME).Get<MongoDbSettings>();
services.AddIdentityMongoDbProvider<User, Role, Guid>(
identityOption => { identityOption.Password.RequiredLength = 8; },
mongoOptions => { mongoOptions.ConnectionString = dbSettings.ConnectionString;});
(here typically the dbSettings.ConnectionString that I would like to edit).
Is there a way to re-run/re-start this?