#445 tajik ganjoor
This commit is contained in:
parent
ce45515236
commit
68aa795e1a
@ -7,7 +7,6 @@ using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RMuseum.Migrations;
|
||||
using RMuseum.Models.Ganjoor;
|
||||
using RMuseum.Models.Ganjoor.ViewModels;
|
||||
using RMuseum.Models.GanjoorAudio;
|
||||
|
||||
46
TajikGanjoor/APIRoot.cs
Normal file
46
TajikGanjoor/APIRoot.cs
Normal file
@ -0,0 +1,46 @@
|
||||
namespace TajikGanjoor
|
||||
{
|
||||
/// <summary>
|
||||
/// API Root
|
||||
/// </summary>
|
||||
public static class APIRoot
|
||||
{
|
||||
/// <summary>
|
||||
/// url
|
||||
/// </summary>
|
||||
public static string Url
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_url))
|
||||
return _url;
|
||||
IConfigurationRoot configuration = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json")
|
||||
.Build();
|
||||
_url = configuration["APIRoot"] ?? "https://api.ganjoor.net";
|
||||
return _url;
|
||||
}
|
||||
}
|
||||
|
||||
private static string _url = "";
|
||||
|
||||
private static string _InternetUrl = "";
|
||||
|
||||
/// <summary>
|
||||
/// internet accessible end point
|
||||
/// </summary>
|
||||
public static string InternetUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_InternetUrl))
|
||||
return _InternetUrl;
|
||||
IConfigurationRoot configuration = new ConfigurationBuilder()
|
||||
.SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json")
|
||||
.Build();
|
||||
_InternetUrl = configuration["GlobalAPIRoot"] ?? "https://api.ganjoor.net";
|
||||
return _InternetUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -16,10 +16,13 @@ namespace TajikGanjoor.Pages
|
||||
return Page();
|
||||
}
|
||||
|
||||
private readonly IConfiguration Configuration;
|
||||
public IndexModel(IConfiguration configuration)
|
||||
protected readonly IConfiguration Configuration;
|
||||
|
||||
protected readonly HttpClient _httpClient;
|
||||
public IndexModel(IConfiguration configuration, HttpClient httpClient)
|
||||
{
|
||||
Configuration = configuration;
|
||||
_httpClient = httpClient;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,22 +1,13 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:37226",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "http://localhost:5001",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"dotnetRunMessages": true,
|
||||
"applicationUrl": "http://localhost:33082"
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
@ -25,5 +16,14 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
},
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:37226",
|
||||
"sslPort": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6,4 +6,8 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="GoogleTranslateFreeApi" Version="1.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -5,5 +5,13 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"AllowedHosts": "*",
|
||||
"GoogleAnalyticsCode": "",
|
||||
"APIRoot": "https://api.ganjoor.net",
|
||||
"GlobalAPIRoot": "https://api.ganjoor.net",
|
||||
"SiteUrl": "http://localhost:33082",
|
||||
"AggressiveCacheEnabled": "False",
|
||||
"BannersEnabled": "False",
|
||||
"ReadOnlyMode": "False",
|
||||
"MaintenanceMode": "False"
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user