Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Group17ProfileMicroservice
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Asif, Adiv (UG - Comp Sci & Elec Eng)
Group17ProfileMicroservice
Commits
46660934
Commit
46660934
authored
1 year ago
by
Adiv Asif
Browse files
Options
Downloads
Plain Diff
Merged PR 16: using cors now
using cors now
parents
071d4be0
4ab06cf4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Program.cs
+14
-0
14 additions, 0 deletions
Program.cs
with
14 additions
and
0 deletions
Program.cs
+
14
−
0
View file @
46660934
...
...
@@ -25,6 +25,18 @@ builder.Services.AddSingleton(mapper);
builder
.
Services
.
AddEndpointsApiExplorer
();
builder
.
Services
.
AddSwaggerGen
();
builder
.
Services
.
AddCors
(
options
=>
{
options
.
AddDefaultPolicy
(
corsPolicyBuilder
=>
{
corsPolicyBuilder
.
WithOrigins
(
builder
.
Configuration
.
GetSection
(
"Group17Website"
)[
"BaseUrl"
]
??
string
.
Empty
)
.
AllowAnyHeader
()
.
AllowAnyMethod
()
.
AllowCredentials
();
});
});
// Add repositories in /Repositories
builder
.
Services
.
AddTransient
(
typeof
(
IBaseRepository
<>),
typeof
(
BaseRepository
<>));
...
...
@@ -41,6 +53,8 @@ if (app.Environment.IsDevelopment())
app
.
UseSwaggerUI
();
}
app
.
UseCors
();
app
.
UseHttpsRedirection
();
app
.
UseAuthorization
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment