mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-02-05 14:49:06 +00:00
Inject an HTTP client into the DI system
This commit is contained in:
parent
5a528357a4
commit
58160f3eaa
@ -10,6 +10,7 @@ using System.Reflection;
|
|||||||
using Microsoft.Extensions.FileProviders;
|
using Microsoft.Extensions.FileProviders;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
var port = args.Length > 0 ? args[0] : "5000";
|
||||||
var builder = WebApplication.CreateBuilder();
|
var builder = WebApplication.CreateBuilder();
|
||||||
builder.Services.AddMudServices(config =>
|
builder.Services.AddMudServices(config =>
|
||||||
{
|
{
|
||||||
@ -37,7 +38,11 @@ builder.Services.AddRazorComponents()
|
|||||||
options.HandshakeTimeout = TimeSpan.FromSeconds(30);
|
options.HandshakeTimeout = TimeSpan.FromSeconds(30);
|
||||||
});
|
});
|
||||||
|
|
||||||
var port = args.Length > 0 ? args[0] : "5000";
|
builder.Services.AddSingleton(new HttpClient
|
||||||
|
{
|
||||||
|
BaseAddress = new Uri($"http://localhost:{port}")
|
||||||
|
});
|
||||||
|
|
||||||
builder.WebHost.UseUrls($"http://localhost:{port}");
|
builder.WebHost.UseUrls($"http://localhost:{port}");
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
Loading…
Reference in New Issue
Block a user