grpc fixes
This commit is contained in:
@@ -15,7 +15,7 @@ pub const HOST: &'static str = "http://localhost:5164";
|
||||
#[cfg(debug_assertions)]
|
||||
pub const RPC_HOST: &'static str = "http://localhost:5164";
|
||||
#[cfg(not(debug_assertions))]
|
||||
pub const RPC_HOST: &'static str = "https://grpc.aoba.app";
|
||||
pub const RPC_HOST: &'static str = "https://grpc.aoba.app:8443";
|
||||
#[cfg(not(debug_assertions))]
|
||||
pub const HOST: &'static str = "https://aoba.app";
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ public static class Extensions
|
||||
services.AddSingleton(dbClient);
|
||||
services.AddSingleton<IMongoDatabase>(db);
|
||||
services.AddSingleton<AobaService>();
|
||||
services.AddSingleton<ThumbnailService>();
|
||||
services.AddSingleton<AccountsService>();
|
||||
services.AddHostedService<AobaIndexCreationService>();
|
||||
return services;
|
||||
|
||||
@@ -18,7 +18,7 @@ internal class ThumbnailService(IMongoDatabase db, AobaService aobaService)
|
||||
|
||||
public async Task<MemoryStream> GetThumbnailAsync(ObjectId id)
|
||||
{
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public async Task GenerateThumbnailAsync(ObjectId id)
|
||||
|
||||
@@ -11,6 +11,18 @@ using Microsoft.AspNetCore.Http.Features;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.WebHost.ConfigureKestrel(o =>
|
||||
{
|
||||
o.ListenAnyIP(8081, lo =>
|
||||
{
|
||||
lo.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http2;
|
||||
});
|
||||
o.ListenAnyIP(8080, lo =>
|
||||
{
|
||||
lo.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http1AndHttp2;
|
||||
});
|
||||
});
|
||||
var config = builder.Configuration;
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllers(opt => opt.ModelBinderProviders.Add(new BsonIdModelBinderProvider()));
|
||||
|
||||
@@ -9,8 +9,6 @@ using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
using Grpc.Core;
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
using MongoDB.Bson.IO;
|
||||
|
||||
using System.Text.Json;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"Kestrel": {
|
||||
"EndpointDefaults": {
|
||||
"Protocols": "Http1AndHttp2",
|
||||
"Protocols": "Http1AndHttp2"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
|
||||
Reference in New Issue
Block a user