small fixes

This commit is contained in:
Michele Scandura 2020-12-08 14:57:10 +00:00
parent 32bc8274a2
commit 2a796509c8
7 changed files with 60 additions and 36 deletions

View file

@ -1,9 +1,11 @@
using Microsoft.AspNetCore.SignalR.Client;
using Microsoft.Extensions.Configuration;
using Polly;
using Refit;
using Sledgemapper.Shared.Entities;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
@ -23,26 +25,27 @@ namespace Sledgemapper
public CommunicationManager(Session sessionData)
{
#if DEBUG
var baseAddress = "http://localhost:5000";
#else
var baseAddress = "http://hub.michelescandura.com:5000";
#endif
SessionData = sessionData;
Connection = new HubConnectionBuilder()
.WithAutomaticReconnect()
//.WithUrl("http://hub.michelescandura.com:5001/SledgemapperHub")
//.WithUrl("http://localhost:5001/SledgemapperHub", options =>
.WithUrl("http://hub.michelescandura.com:5000/SledgemapperHub", options =>
{
options.AccessTokenProvider = () => Task.FromResult(_authenticateResponse.Token);
})
.WithUrl($"{baseAddress}/SledgemapperHub", options =>
{
options.AccessTokenProvider = () => Task.FromResult(_authenticateResponse.Token);
})
.Build();
Api = RestService.For<IMapApi>(
new HttpClient(new AuthenticatedHttpClientHandler(GetToken))
{
BaseAddress = new Uri("http://hub.michelescandura.com:5000")
// BaseAddress = new Uri("http://localhost:5001")
BaseAddress = new Uri(baseAddress)
}
);