File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
ASPCore-FileManager-WebAPI/ASPCore-FileManager-WebAPI Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 66
77// Add services to the container.
88builder . Services . AddRazorPages ( ) ;
9+ builder . Services . AddControllers ( ) ;
910builder . Services . AddCors ( options =>
1011{
11- options . AddPolicy ( "AllowAllOrigins" , builder =>
12+ options . AddPolicy ( "AllowAllOrigins" , policy =>
1213 {
13- builder . AllowAnyOrigin ( )
14+ policy . AllowAnyOrigin ( )
1415 . AllowAnyMethod ( )
1516 . AllowAnyHeader ( ) ;
1617 } ) ;
4142app . UseStaticFiles ( ) ;
4243
4344app . UseRouting ( ) ;
45+ app . UseCors ( "AllowAllOrigins" ) ;
4446app . UseAuthentication ( ) ;
4547app . UseAuthorization ( ) ;
4648
49+ app . MapControllers ( ) ;
4750app . MapRazorPages ( ) ;
48- app . UseCors ( "AllowAllOrigins" ) ;
49- app . UseEndpoints ( endPoints =>
50- {
51- endPoints . MapControllers ( ) ;
52- } ) ;
5351app . Run ( ) ;
You can’t perform that action at this time.
0 commit comments