Compare commits

...

2 Commits

Author SHA1 Message Date
9ab29a3a15 Update some packages 2025-04-24 19:07:52 +03:30
6c5fe1bc00 Added cors 2025-04-24 19:07:43 +03:30
3 changed files with 15 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
using CatsOfMastodonBot.Models;
using CatsOfMastodonBot.Services;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using mstdnCats.Services;
@@ -41,12 +42,22 @@ public class MastodonBot
{
options.ListenAnyIP(5005); // Listen on port 5005
});
webBuilder.ConfigureServices(services =>
{
services.AddCors(options =>
{
options.AddDefaultPolicy(options =>
{
options.AllowAnyHeader()
.AllowAnyMethod()
.AllowAnyOrigin();
});
});
} );
ServerStartup.Serverstartup(db);
webBuilder.UseStartup<ServerStartup>();
})
.Build();
// Setup bot
TelegramBotClient bot;

View File

@@ -19,7 +19,7 @@ public class ServerStartup
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseRouting();
app.UseCors();
app.UseEndpoints(endpoints =>
{
endpoints.MapGet("/", async context =>

View File

@@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="DotNetEnv" Version="3.1.1" />
<PackageReference Include="MongoDB.Driver" Version="3.2.1" />
<PackageReference Include="MongoDB.Driver" Version="3.3.0" />
<PackageReference Include="Telegram.Bot" Version="22.4.4" />
</ItemGroup>