I've done most of the part but here are some things that I really dont know much about..
Also how to end request/completerequest? Generate the code into .net core code
private static void SetCorsResponse(HttpContext context)
{
context.Response.Headers.Append("Access-Control-Allow-Methods", "OPTIONS,GET,POST,PUT,PATCH,DELETE");
context.Response.Headers.Append("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Requested-With");
context.Response.Headers.Append("Access-Control-Expose-Headers", "*");
context.Response.StatusCode = 200;
**HttpContext.Current.ApplicationInstance.CompleteRequest();**
}