mirror of
https://github.com/yawaflua/yaflay.ru.git
synced 2026-04-25 09:10: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.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using System.Xml.Schema;
|
||||
|
||||
@@ -21,7 +22,10 @@ namespace yaflay.ru.Новая_папка
|
||||
HttpClient client = new();
|
||||
HttpResponseMessage getter = await client.GetAsync("https://raw.githubusercontent.com/YaFlay/yaflay.ru/master/redirect_uris.json");
|
||||
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];
|
||||
}
|
||||
catch (Exception except)
|
||||
|
||||
+11
-1
@@ -1,22 +1,32 @@
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
using HeyRed.OEmbed;
|
||||
namespace yaflay.ru
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
private readonly IConfiguration configuration;
|
||||
private readonly OEmbedOptions options;
|
||||
public Startup()
|
||||
{
|
||||
configuration = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables(prefix: "m.")
|
||||
.AddJsonFile("appsettings.json", optional: true)
|
||||
.Build();
|
||||
options = new OEmbedOptions()
|
||||
{
|
||||
EnableCache = true
|
||||
};
|
||||
}
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddControllers();
|
||||
services.AddRouting();
|
||||
services.AddRazorPages();
|
||||
services.AddOEmbed(options =>
|
||||
{
|
||||
options.EnableCache = true; // true by default
|
||||
options.EnsureNotNull();
|
||||
});
|
||||
//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>
|
||||
<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>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user