From e1eb46ae6e80be20a032d55b32cd11a47d884fd5 Mon Sep 17 00:00:00 2001
From: Felix Schmoll <eggi.innovations@gmail.com>
Date: Mon, 9 Nov 2015 12:10:18 +0100
Subject: [PATCH] allowed CORS for /dumps

---
 index.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 0a8cd73..647a64c 100644
--- a/index.js
+++ b/index.js
@@ -26,7 +26,7 @@ app.use(bodyParser.urlencoded({
 
 // serve only *.xhtml documents
 app.use('/docs', function(req, res, next){
-  res.set('Access-Control-Allow-Origin', 'http://localhost:3000');
+  res.set('Access-Control-Allow-Origin', '*');
   if(req.path.endsWith('.xhtml')){
     next();
   } else {
@@ -35,6 +35,7 @@ app.use('/docs', function(req, res, next){
 }, express.static('docs/'));
 
 app.post('/dumps/', function(req, res, next){
+  res.set('Access-Control-Allow-Origin', '*');
   // read post data from the body
   var post_data = req.body || {};
   var id, doc;
@@ -72,6 +73,7 @@ app.post('/dumps/', function(req, res, next){
 });
 
 app.use('/dumps', function(req, res, next){
+  
   if(req.path.endsWith('.xhtml')){
     next();
   } else {
@@ -93,7 +95,7 @@ app.get('/get_task', function(req, res){
   // get a mode
   var mode = ['annotate', 'review'][Math.random() > 0.5 ? 0 : 1]
 
-  res.set('Access-Control-Allow-Origin', 'http://localhost:3000');
+  res.set('Access-Control-Allow-Origin', '*');
 
   // TODO: Serve a proper document and result
   res.jsonp({
-- 
GitLab