mirror of
https://github.com/yawaflua/yaflay.ru.git
synced 2026-04-25 17:20:38 +03:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0fa9a491ae | |||
| 11cc55256f | |||
| 998d697622 | |||
| 6ff6867b70 | |||
| 8b5b7cd352 | |||
| 83b8c22acf | |||
| abdf1da3d5 | |||
| 489633a7a6 | |||
| 820d8b8f8b | |||
| 22851d0465 |
@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
using System.Text.Json.Nodes;
|
using System.Text.Json.Nodes;
|
||||||
using System.Xml.Schema;
|
using System.Xml.Schema;
|
||||||
|
|
||||||
@@ -21,7 +22,10 @@ namespace yaflay.ru.Новая_папка
|
|||||||
HttpClient client = new();
|
HttpClient client = new();
|
||||||
HttpResponseMessage getter = await client.GetAsync("https://raw.githubusercontent.com/YaFlay/yaflay.ru/master/redirect_uris.json");
|
HttpResponseMessage getter = await client.GetAsync("https://raw.githubusercontent.com/YaFlay/yaflay.ru/master/redirect_uris.json");
|
||||||
await Console.Out.WriteLineAsync(await getter.Content.ReadAsStringAsync());
|
await Console.Out.WriteLineAsync(await getter.Content.ReadAsStringAsync());
|
||||||
JsonNode allFile = JsonNode.Parse(await getter.Content.ReadAsStringAsync());
|
JsonNodeOptions jsonNodeOptions = new ();
|
||||||
|
JsonDocumentOptions jsonDocumentOptions = new();
|
||||||
|
jsonDocumentOptions.AllowTrailingCommas = true;
|
||||||
|
JsonNode allFile = JsonNode.Parse(await getter.Content.ReadAsStringAsync(), jsonNodeOptions, jsonDocumentOptions);
|
||||||
return (string?)allFile[baseUrl];
|
return (string?)allFile[baseUrl];
|
||||||
}
|
}
|
||||||
catch (Exception except)
|
catch (Exception except)
|
||||||
|
|||||||
+11
-1
@@ -1,22 +1,32 @@
|
|||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using HeyRed.OEmbed;
|
||||||
namespace yaflay.ru
|
namespace yaflay.ru
|
||||||
{
|
{
|
||||||
public class Startup
|
public class Startup
|
||||||
{
|
{
|
||||||
private readonly IConfiguration configuration;
|
private readonly IConfiguration configuration;
|
||||||
|
private readonly OEmbedOptions options;
|
||||||
public Startup()
|
public Startup()
|
||||||
{
|
{
|
||||||
configuration = new ConfigurationBuilder()
|
configuration = new ConfigurationBuilder()
|
||||||
.AddEnvironmentVariables(prefix: "m.")
|
.AddEnvironmentVariables(prefix: "m.")
|
||||||
.AddJsonFile("appsettings.json", optional: true)
|
.AddJsonFile("appsettings.json", optional: true)
|
||||||
.Build();
|
.Build();
|
||||||
|
options = new OEmbedOptions()
|
||||||
|
{
|
||||||
|
EnableCache = true
|
||||||
|
};
|
||||||
}
|
}
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddControllers();
|
services.AddControllers();
|
||||||
services.AddRouting();
|
services.AddRouting();
|
||||||
services.AddRazorPages();
|
services.AddRazorPages();
|
||||||
|
services.AddOEmbed(options =>
|
||||||
|
{
|
||||||
|
options.EnableCache = true; // true by default
|
||||||
|
options.EnsureNotNull();
|
||||||
|
});
|
||||||
//services.AddDirectoryBrowser();
|
//services.AddDirectoryBrowser();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+12
-1
@@ -1 +1,12 @@
|
|||||||
{ "github": "https://github.com/YaFlay", "bump": "https://discord.gg/bump-1119294432949325955", "shitpost": "https://t.me/yaflay_shitposts", "boosty": "https://boosty.to/yaflay", "storespw": "https://github.com/PoopStore-Team" }
|
{
|
||||||
|
"github": "https://github.com/YaFlay",
|
||||||
|
"gh": "https://github.com/YaFlay",
|
||||||
|
"bump": "https://discord.gg/bump-1119294432949325955",
|
||||||
|
"shitpost": "https://t.me/yaflay_shitposts",
|
||||||
|
"boosty": "https://boosty.to/yaflay",
|
||||||
|
"storespw": "https://github.com/PoopStore-Team",
|
||||||
|
"gh-team": "https://github.com/PoopStore-Team",
|
||||||
|
"twitch": "https://twitch.tv/bebra_yaflay",
|
||||||
|
"patreon": "https://patreon.com/yaflay",
|
||||||
|
"steam": "https://steamcommunity.com/id/bebra_YaFlay/"
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
|
||||||
|
<PackageReference Include="OEmbed" Version="3.0.0" />
|
||||||
|
<PackageReference Include="OEmbed.Extensions.Microsoft.DependencyInjection" Version="3.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user