mirror of
https://github.com/chsakell/aspnet-core-signalr-angular.git
synced 2025-12-22 17:27:48 +00:00
fix api URLs refs
This commit is contained in:
@@ -12,8 +12,6 @@ namespace LiveGameFeed.Core
|
|||||||
{
|
{
|
||||||
private ILogger logger;
|
private ILogger logger;
|
||||||
IMatchRepository _matchRepository;
|
IMatchRepository _matchRepository;
|
||||||
private string _apiURI = "http://localhost:5000/api/";
|
|
||||||
|
|
||||||
public FeedEngine(IMatchRepository matchRepository,
|
public FeedEngine(IMatchRepository matchRepository,
|
||||||
ILogger<FeedEngine> logger)
|
ILogger<FeedEngine> logger)
|
||||||
{
|
{
|
||||||
@@ -51,7 +49,7 @@ namespace LiveGameFeed.Core
|
|||||||
// Update Score for all clients
|
// Update Score for all clients
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
await client.PutAsJsonAsync<MatchScore>(_apiURI + "matches/" + match.Id, score);
|
await client.PutAsJsonAsync<MatchScore>(Startup.API_URL + "matches/" + match.Id, score);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update Feed for subscribed only clients
|
// Update Feed for subscribed only clients
|
||||||
@@ -64,7 +62,7 @@ namespace LiveGameFeed.Core
|
|||||||
};
|
};
|
||||||
using (var client = new HttpClient())
|
using (var client = new HttpClient())
|
||||||
{
|
{
|
||||||
await client.PostAsJsonAsync<FeedViewModel>(_apiURI + "feeds", _feed);
|
await client.PostAsJsonAsync<FeedViewModel>(Startup.API_URL + "feeds", _feed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace LiveGameFeed
|
|||||||
{
|
{
|
||||||
public class Startup
|
public class Startup
|
||||||
{
|
{
|
||||||
|
public static string API_URL = string.Empty;
|
||||||
public Startup(IHostingEnvironment env)
|
public Startup(IHostingEnvironment env)
|
||||||
{
|
{
|
||||||
var builder = new ConfigurationBuilder()
|
var builder = new ConfigurationBuilder()
|
||||||
@@ -25,6 +26,8 @@ namespace LiveGameFeed
|
|||||||
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
|
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
|
||||||
.AddEnvironmentVariables();
|
.AddEnvironmentVariables();
|
||||||
Configuration = builder.Build();
|
Configuration = builder.Build();
|
||||||
|
|
||||||
|
API_URL = Configuration["apiURL"];
|
||||||
}
|
}
|
||||||
|
|
||||||
public IConfigurationRoot Configuration { get; }
|
public IConfigurationRoot Configuration { get; }
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export class ConfigService {
|
|||||||
_apiURI : string;
|
_apiURI : string;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this._apiURI = 'http://localhost:5000/api/';
|
this._apiURI = 'api/';
|
||||||
}
|
}
|
||||||
|
|
||||||
getApiURI() {
|
getApiURI() {
|
||||||
|
|||||||
@@ -6,5 +6,6 @@
|
|||||||
"System": "Information",
|
"System": "Information",
|
||||||
"Microsoft": "Information"
|
"Microsoft": "Information"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"apiURL" : "http://localhost:5000/api/"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user