Compare commits
2 Commits
8f9396c791
...
9ab29a3a15
Author | SHA1 | Date | |
---|---|---|---|
9ab29a3a15 | |||
6c5fe1bc00 |
15
Program.cs
15
Program.cs
@@ -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,13 +42,23 @@ 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;
|
||||
if (!String.IsNullOrEmpty(config.SOCKS_PROXY))
|
||||
|
@@ -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 =>
|
||||
|
@@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user