@igea/oac_backend 1.0.71 → 1.0.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igea/oac_backend",
3
- "version": "1.0.71",
3
+ "version": "1.0.73",
4
4
  "description": "Backend service for the OAC project",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/config.js CHANGED
@@ -17,8 +17,9 @@ function loadConfig() {
17
17
  config.exposed.protocol = process.env.OAC_EXPOSED_PROTOCOL || config.exposed.protocol;
18
18
  config.exposed.host = process.env.OAC_EXPOSED_HOST || config.exposed.host;
19
19
  config.exposed.port = process.env.OAC_EXPOSED_PORT || config.exposed.port;
20
-
20
+ if(config.exposed.host == 'localhost') config.exposed.host = '127.0.0.1'
21
+
21
22
  return config;
22
23
  }
23
24
 
24
- module.exports = loadConfig();
25
+ module.exports = loadConfig();
@@ -256,6 +256,7 @@ router.get('/get-vocabolary-terms/:key', (req, res) => {
256
256
  responseType: 'text'
257
257
  }).then(response => {
258
258
  res.setHeader('Content-Type', response.headers['content-type']);
259
+ res.header('Access-Control-Allow-Origin', '*');
259
260
  CacheVocabularies.set(key, response.data); // salva come stringa
260
261
  res.send(response.data);
261
262
  }).catch(err => {
@@ -622,4 +623,4 @@ router.post('/endpoint/update', (req, res) => {
622
623
  }
623
624
  })
624
625
 
625
- module.exports = router
626
+ module.exports = router