added cors and added produces json.
This commit is contained in:
parent
5df2fa99ce
commit
cf2450f5f7
@ -74,6 +74,7 @@ namespace Demo
|
|||||||
services.AddPoweredSoftGraphQLFluentValidation();
|
services.AddPoweredSoftGraphQLFluentValidation();
|
||||||
|
|
||||||
services.AddSwaggerGen();
|
services.AddSwaggerGen();
|
||||||
|
services.AddCors();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddDynamicQueries(IServiceCollection services)
|
private void AddDynamicQueries(IServiceCollection services)
|
||||||
@ -113,6 +114,8 @@ namespace Demo
|
|||||||
|
|
||||||
app.UseHttpsRedirection();
|
app.UseHttpsRedirection();
|
||||||
|
|
||||||
|
app.UseCors(o => o.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod());
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace PoweredSoft.CQRS.AspNetCore.Mvc
|
namespace PoweredSoft.CQRS.AspNetCore.Mvc
|
||||||
{
|
{
|
||||||
|
[Produces("application/json")]
|
||||||
[ApiController, Route("api/command/[controller]")]
|
[ApiController, Route("api/command/[controller]")]
|
||||||
public class CommandController<TCommand> : Controller
|
public class CommandController<TCommand> : Controller
|
||||||
where TCommand : class
|
where TCommand : class
|
||||||
@ -23,6 +24,7 @@ namespace PoweredSoft.CQRS.AspNetCore.Mvc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Produces("application/json")]
|
||||||
[ApiController, Route("api/command/[controller]")]
|
[ApiController, Route("api/command/[controller]")]
|
||||||
public class CommandController<TCommand, TTCommandResult> : Controller
|
public class CommandController<TCommand, TTCommandResult> : Controller
|
||||||
where TCommand : class
|
where TCommand : class
|
||||||
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace PoweredSoft.CQRS.AspNetCore.Mvc
|
namespace PoweredSoft.CQRS.AspNetCore.Mvc
|
||||||
{
|
{
|
||||||
|
[Produces("application/json")]
|
||||||
[ApiController, Route("api/query/[controller]")]
|
[ApiController, Route("api/query/[controller]")]
|
||||||
public class QueryController<TQuery, TQueryResult> : Controller
|
public class QueryController<TQuery, TQueryResult> : Controller
|
||||||
where TQuery : class
|
where TQuery : class
|
||||||
|
Loading…
Reference in New Issue
Block a user