Enable CORS

This commit is contained in:
2023-08-25 18:06:33 +01:00
parent 092804f023
commit 9f1a4f6134
3 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,7 @@ using System.Security.Cryptography;
using System.Text;
using BTCPayServer.Lightning;
using LNURL;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Nostr.Client.Json;
@ -13,6 +14,7 @@ using NostrStreamer.Services;
namespace NostrStreamer.Controllers;
[Route("/api/pay")]
[EnableCors]
public class LnurlController : Controller
{
private readonly Config _config;

View File

@ -1,10 +1,10 @@
using System.Security.Claims;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using Nostr.Client.Json;
using Nostr.Client.Messages;
using NostrStreamer.ApiModel;
using NostrStreamer.Database;
using NostrStreamer.Services;
@ -13,6 +13,7 @@ using NostrStreamer.Services.StreamManager;
namespace NostrStreamer.Controllers;
[Authorize]
[EnableCors]
[Route("/api/nostr")]
public class NostrController : Controller
{

View File

@ -1,5 +1,6 @@
using System.Text.RegularExpressions;
using MediaFormatLibrary.MP4;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using NostrStreamer.Database;
using NostrStreamer.Services;
@ -8,6 +9,7 @@ using NostrStreamer.Services.StreamManager;
namespace NostrStreamer.Controllers;
[Route("/api/playlist")]
[EnableCors]
public class PlaylistController : Controller
{
private readonly ILogger<PlaylistController> _logger;