nemanja.grkovic 3 роки тому
джерело
коміт
78f0d53c78

+ 2
- 1
IdentityProvider/Program.cs Переглянути файл

@@ -57,6 +57,7 @@ if (app.Environment.IsDevelopment())
}
else
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
@@ -86,4 +87,4 @@ app.MapCodeFirstGrpcReflectionService();

app.MapFallbackToFile("index.html");

app.Run();
app.Run("http://127.0.0.1:5002");

+ 3
- 2
SpotifyWorker/Worker.cs Переглянути файл

@@ -18,7 +18,7 @@ namespace SpotifyWorker
{
_logger = logger;
// AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
_serviceClient = GrpcChannel.ForAddress("https://localhost:5051/").CreateGrpcService<IStatsService>();
_serviceClient = GrpcChannel.ForAddress("https://localhost:5001/").CreateGrpcService<IStatsService>();
}
//public override Task StartAsync(CancellationToken cancellationToken)
//{
@@ -68,7 +68,8 @@ namespace SpotifyWorker
await Task.Delay(5000, stoppingToken);
try
{
var res = await _serviceClient.GetCurrentlyPlayingTrack(new GrpcShared.DTO.SessionMessage { UserId = "6308a8bfc731f7b44d76ac4e" });
var res = await _serviceClient.GetCurrentlyPlayingTrack(new GrpcShared.DTO.SessionMessage { UserId = "630ddbad89698131d98dc0fd" });
Console.WriteLine(res.Item!.Name);

}
catch (RpcException e)

+ 2
- 1
gRPCServer/GLOBALS.cs Переглянути файл

@@ -7,7 +7,8 @@ namespace SpotifyService
public const String MEDIATYPE = "application/json";
public const string CLIENT_ID = "83e1d09876b049c4bb1953185a4b3bfb";
public const string SECRET = "ea752433d0774fad87fab5c1ee788c8d";
public const string REDIRECT_URI = "http://localhost:5051/callback";
//public const string REDIRECT_URI = "http://localhost:5051/callback";
public const string REDIRECT_URI = "https://localhost:5001/callback";
public const string SCOPE = "user-read-currently-playing user-read-email user-library-modify user-top-read user-read-private";
/*
"ClientId": "83e1d09876b049c4bb1953185a4b3bfb",

+ 7
- 7
gRPCServer/Program.cs Переглянути файл

@@ -13,13 +13,13 @@ var builder = WebApplication.CreateBuilder(args);

#if DEBUG

builder.WebHost.ConfigureKestrel(options =>
{
options.ListenLocalhost(5050, o => o.Protocols =
HttpProtocols.Http2);
options.ListenLocalhost(5051, o => o.Protocols =
HttpProtocols.Http1AndHttp2);
});
//builder.WebHost.ConfigureKestrel(options =>
//{
// options.ListenLocalhost(5050, o => o.Protocols =
// HttpProtocols.Http2);
// options.ListenLocalhost(5051, o => o.Protocols =
// HttpProtocols.Http1AndHttp2);
//});

#endif


+ 1
- 1
gRPCServer/appsettings.json Переглянути файл

@@ -13,7 +13,7 @@
},
"AuthParams": {
"ClientId": "83e1d09876b049c4bb1953185a4b3bfb",
"RedirectURI": "http://localhost:5051/callback",
"RedirectURI": "https://localhost:5001/callback",
"Scope": "user-read-currently-playing user-read-email user-library-modify user-top-read user-read-private",
"ClientSecret": "ea752433d0774fad87fab5c1ee788c8d"
}

Завантаження…
Відмінити
Зберегти