Adding a Blazor WASM app
This commit is contained in:
Binary file not shown.
@@ -9,7 +9,6 @@ using System.Text.Json;
|
||||
namespace CityInfo.API.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Authorize]
|
||||
[Route("api/cities")]
|
||||
public class CitiesController: ControllerBase
|
||||
{
|
||||
|
||||
@@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Mvc;
|
||||
namespace CityInfo.API.Controllers
|
||||
{
|
||||
[Route("api/cities/{cityId}/pointsofinterest/", Name = "GetPointsOfInterest")]
|
||||
[Authorize(Policy = "MustBeFromCharleroi")]
|
||||
[ApiController]
|
||||
public class PointsOfInterestController : ControllerBase
|
||||
{
|
||||
|
||||
@@ -75,6 +75,11 @@ builder.Services.AddAuthorization(options =>
|
||||
});
|
||||
});
|
||||
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy("Open", builder => builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod());
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
if (!app.Environment.IsDevelopment())
|
||||
@@ -101,6 +106,8 @@ app.UseAuthentication();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.UseCors("Open");
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
|
||||
Reference in New Issue
Block a user