mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 12:11:10 +00:00
Adds typed HTTP client to the Web client, for interacting with the API.
This commit is contained in:
1 parent
d8c64920dc
commit
4301b0a3ee
9 files changed
+409
-7
No files matched your search
@@ -24,6 +24,15 @@ public static class PresentationApiLayerServices
|
||||
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
|
||||
public static IServiceCollection AddPresentationApiLayerServices(this IServiceCollection services)
|
||||
{
|
||||
services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy("AllowAll",
|
||||
builder => builder
|
||||
.AllowAnyOrigin()
|
||||
.AllowAnyMethod()
|
||||
.AllowAnyHeader());
|
||||
});
|
||||
|
||||
// add services to the container
|
||||
services.AddControllers().AddJsonOptions(options =>
|
||||
{
|
||||
|
||||
@@ -31,6 +31,8 @@ public class Program
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseCors("AllowAll");
|
||||
|
||||
app.UseExceptionHandler("/error"); // uses a middleware which reexecutes the request to the error path
|
||||
|
||||
// configure the HTTP request pipeline.
|
||||
|
||||
Reference in new issue
Block a user