Browse Source

Merge pull request #6 from Tschaul/enable-cors

cross-origin resource sharing (CORS)
master
digital-dreamer 10 years ago
parent
commit
2181f8b24b
  1. 1
      package.json
  2. 3
      twister-proxy.js

1
package.json

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
"dependencies":
{
"express": ">=2.5.x",
"cors": "*",
"log-timestamp": ">=0.1.1"
},
"repository": {

3
twister-proxy.js

@ -5,6 +5,7 @@ var express = require("express"); @@ -5,6 +5,7 @@ var express = require("express");
var console = require("console");
var app = express();
var cors = require('cors');
try
{
@ -73,6 +74,8 @@ CounterInstance = function() @@ -73,6 +74,8 @@ CounterInstance = function()
require("log-timestamp");
app.use(cors());
app.get("*", function(request, response)
{
if(settings.Server.enable_https&&request.protocol=="http")

Loading…
Cancel
Save