Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- services.AddMvc();
- services.AddCors(
- options => options.AddPolicy("AllowCors",
- builder =>
- {
- builder
- .AllowAnyOrigin() //AllowAllOrigins;
- .AllowAnyMethod() //AllowAllMethods;
- .AllowAnyHeader(); //AllowAllHeaders;
- })
- );
- //Enable CORS policy "AllowCors"
- app.UseCors("AllowCors");
- app.UseMvc();
- [EnableCors("AllowCors")]
- [Route("api/Songs")]
- public class SongsController : Controller
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement