-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lets make the task better for the candidates - Added CORS, to save the candidate some time - Added another endpoint to have an even better starting point where there are examples for query parameters and some more linq expressions in the code
- Loading branch information
Martin Klingenberg
committed
Oct 18, 2024
1 parent
202ccda
commit d7b0f22
Showing
7 changed files
with
84 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
using Alv.Parkering.Infrastructure; | ||
|
||
var builder = WebApplication.CreateBuilder(args); | ||
var AllowedOrigins = "_allowedOrigins"; | ||
|
||
// Add services to the container. | ||
|
||
builder.Services.AddControllers(); | ||
builder.Services.AddInfrastructure(); | ||
|
||
builder.Services.AddCors(options => | ||
{ | ||
options.AddPolicy( | ||
name: AllowedOrigins, | ||
policy => | ||
{ | ||
policy.WithOrigins("*", "*"); | ||
} | ||
); | ||
}); | ||
|
||
var app = builder.Build(); | ||
|
||
app.UseCors(AllowedOrigins); | ||
app.MapControllers(); | ||
|
||
app.Run(); |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters