Recently while debugging an application I needed to design REST and JSON api calls across DNS domains. However, the client browser Chrome blocked those HTTP transactions due to CORS. While essential to production security, this can be a roadblock to developer productivity locally. The below steps show how to launch Chrome browser with CORS security temporarily disabled. This can help remove complexity and security warnings to focus first on application features.
Once stable, we can add CORS support to the endpoint APIs (HTTP header Access-Control-Allow-Origin:*) and calling JS application.
Here we add “spcrud.ts” library with CRUD methods to save JSON data over REST api into SharePoint Lists.
SPCRUD is a Typescript library with methods to easily interact with SharePoint APIs by providing management of Digest Token, HTTP headers, and URL formatting. As developers we interact with simple TypeScript methods that have input validation which in turn execute the correct underlying HTTP call.