Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void ConfigureServices(IServiceCollection services)
- {
- WriteToFile("In configure service");
- try
- {
- // Enable Cors
- services.AddCors();
- services.AddMvc();
- }
- catch
- {
- WriteToFile("Not Connected in StartUP");
- }
- }
- // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
- public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
- {
- try
- {
- app.UseCors(builder =>
- builder.AllowAnyOrigin()
- .AllowAnyHeader()
- .AllowAnyMethod());
- app.UseMvc();
- WriteToFile("After cors use In configure");
- }
- catch(Exception ex)
- {
- WriteToFile("Error in configure"+ex.Message);
- }
- }
Add Comment
Please, Sign In to add comment