Commit f9c9a14861ba5d25073af320894e1d149933014e

Authored by Adabriand Furtado
1 parent e19811f1
Exists in master

Adicionado o pacote CORS.

Showing 2 changed files with 5 additions and 3 deletions   Show diff stats
@@ -61,8 +61,8 @@ uninstall: clean @@ -61,8 +61,8 @@ uninstall: clean
61 @sudo apt-get -y install gcc make build-essential npm 61 @sudo apt-get -y install gcc make build-essential npm
62 @sudo ln -sf "$$HOME" "wikilibras_server" 62 @sudo ln -sf "$$HOME" "wikilibras_server"
63 @sudo npm cache clean 63 @sudo npm cache clean
64 - @sudo npm install -g forever node-gyp  
65 - @sudo npm link forever node-gyp 64 + @sudo npm install -g forever node-gyp cors
  65 + @sudo npm link forever node-gyp cors
66 @sudo npm install 66 @sudo npm install
67 67
68 .update: 68 .update:
@@ -11,8 +11,10 @@ var path = require('path'); @@ -11,8 +11,10 @@ var path = require('path');
11 var express = require('express'); 11 var express = require('express');
12 var bodyParser = require('body-parser'); 12 var bodyParser = require('body-parser');
13 var PythonShell = require('python-shell'); 13 var PythonShell = require('python-shell');
  14 +var cors = require('cors');
14 15
15 var app = express(); 16 var app = express();
  17 +app.use(cors())
16 18
17 /* SSL configuration */ 19 /* SSL configuration */
18 var privateKey = fs.readFileSync('sslcert/server.key', 'utf8'); 20 var privateKey = fs.readFileSync('sslcert/server.key', 'utf8');
@@ -78,4 +80,4 @@ app.delete('/api/:hash', function(req, res) { @@ -78,4 +80,4 @@ app.delete('/api/:hash', function(req, res) {
78 var httpsServer = https.createServer(credentials, app); 80 var httpsServer = https.createServer(credentials, app);
79 httpsServer.listen(properties.PORT, properties.HOST, function() { 81 httpsServer.listen(properties.PORT, properties.HOST, function() {
80 console.log('Server running on ' + properties.HOST + ':' + properties.PORT); 82 console.log('Server running on ' + properties.HOST + ':' + properties.PORT);
81 -});  
82 \ No newline at end of file 83 \ No newline at end of file
  84 +});