This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cors() { | |
// Allow from any origin | |
if (isset($_SERVER['HTTP_ORIGIN'])) { | |
// Decide if the origin in $_SERVER['HTTP_ORIGIN'] is one | |
// you want to allow, and if so: | |
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}"); | |
header('Access-Control-Allow-Credentials: true'); | |
header('Access-Control-Max-Age: 86400'); // cache for 1 day | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//a modified version of a gist ...which I forgot the URL of | |
var url = require('url') | |
, http = require('http') | |
, https = require('https'); | |
var fs = require('fs'); | |
var PORT = process.argv[2] || 443; |
NewerOlder