Skip to content

Instantly share code, notes, and snippets.

@thedude42
Created March 31, 2015 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedude42/76a88852cb8710b03a69 to your computer and use it in GitHub Desktop.
Save thedude42/76a88852cb8710b03a69 to your computer and use it in GitHub Desktop.
CORS inline script
script corsService
source inline "ENDWORD_corsService"
"use strict";
var cors = require("./cors_server.js"),
service = new cors.CorsService("MyVirtualServerName", "our-default-origin.com",
{"/api/v1.0/json":
{"origins":["our-default-origin.com", "another-allowed-origin.com"],
"allowCreds":false,
"allowHeaders":["X-special-header"],
"methods":['GET','HEAD']
},
"maxage": 3600
});
ENDWORD_corsService
admin-status online
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment