/cors-demo

Minimal example of using cors

Primary LanguageHTMLApache License 2.0Apache-2.0

Cors demo

Minimal example of using CORS.

Instructions for setting up demo using nginx:

  • copy files from nginx.conf in /etc/nginx/conf.d/ . Be careful to modify root to clone location of repository.
  • add records in /etc/hosts for redirecting cors-client.com and cors-server.com to nginx ip.
  • install npm dependencies and run server:
$> cd server
$> npm install
$> node server.js

The only catch is the response from the server must contain "Access-Control-Allow-Origin: http://cors-client.com" header.