Update base URL retrieval to use configuration setting
Replaced hardcoded base URL construction with a configuration-based approach for better management and flexibility. Updated `appsettings.json` to include the new `BaseUrl` setting under the `Hosting` section.
This commit is contained in:
parent
b8083193bd
commit
5b583f45d6
|
|
@ -2,7 +2,7 @@
|
|||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@inject IConfiguration Configuration;
|
||||
@{
|
||||
var baseUrl = $"{Request.Scheme}://{Request.Host}";
|
||||
var baseUrl = Configuration["Hosting:BaseUrl"]!;
|
||||
var apiUrl = baseUrl + Url.Content("~/elsa/api");
|
||||
var basePath = Configuration["Hosting:BasePath"]!;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
"MySql": "Server=localhost;Database=elsa;Uid=user;Pwd=password;"
|
||||
},
|
||||
"Hosting": {
|
||||
"BaseUrl": "https://localhost:5001",
|
||||
"BasePath": ""
|
||||
},
|
||||
"Identity": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue