Comments (6)
The env vars STH supports are described in https://github.com/telefonicaid/fiware-sth-comet/blob/master/doc/manuals/running.md. It seems there isn't any one related with CORS.
However, it shouldn't be difficult to add them, looking how others env vars have been implemented and do a similar thing. It would be great if you could provide a pull request with the improvement, pls ;)
Having said that, we don't use to enable CORS in backend services. But if you need it and want to implement it in STH, ok with us.
from fiware-sth-comet.
I changed the sthConfiguration.js file in the lib/configuration folder (I used ENV.CORS_ENABLED var and I added an if/else clause before of 226 line) as follow:
if (ENV.CORS_ENABLED && !isNull(ENV.CORS_ENABLED)) {
module.exports.corsEnabled = JSON.parse(ENV.CORS_ENABLED);
sthLogger.info(module.exports.LOGGING_CONTEXT.STARTUP, 'CORS value set to: ' + module.exports.corsEnabled);
} else if (config && config.cors && config.cors.enabled) {
I tried a test locally (on my Win PC);
I also created (locally) a docker image (i.e. sth-comet:2.11.0) just copying the Dockerfile into the root directory, and I edited it to use my local changes.
It worked using - CORS_ENABLED=true
env var in my docker-compose file (see above). In the log file: msg=CORS value set to: true
Please let me know if it should be updated docs and tests
from fiware-sth-comet.
I'd suggest to create a PR with the proposed fix, so we can provide feedback on it, please.
from fiware-sth-comet.
I created locally a task/cors_conf_docker branch but I cannot push it in the repo because I'm not authorized.
Is it the right way to create a PR?
from fiware-sth-comet.
I created locally a task/cors_conf_docker branch but I cannot push it in the repo because I'm not authorized. Is it the right way to create a PR?
You can do it using a fork (eg: PR #605)
from fiware-sth-comet.
PR #620
from fiware-sth-comet.
Related Issues (20)
- non enough permissions over temp directory HOT 1
- Configured Cygnus with STH-comet, but unable to retrieve data from Mongo DB HOT 18
- Issue with some parameters of the STH API HOT 4
- Response gets mixed when multiple requests are executed simultaneously with filetype=csv HOT 11
- Incorrect Response format when filetype=csv is used with hLimit and hOffset HOT 3
- Problem when querying Raw Data with STH-Comet - Returns empty HOT 3
- Seen sth collections with double slash HOT 3
- SemVer Docker images missing HOT 11
- Missleading trace information HOT 1
- Sth-Comet does not reconnect with MongoDB. HOT 17
- migrate mongo driver from 2.2.X to 3.6.Y HOT 1
- Return 500 when DB is not connected HOT 16
- MongoDB 5.0 errores running unit tests (maybe something in STH implementation should be fixed?)
- Cannot create seperate records per update or sth tables on MongoDB. HOT 3
- Problem on persisting first data payload on MongoDB when creating a new collection at the same time HOT 4
- MongoDB should connect to STH sever after reconnectTries value is exhausted HOT 6
- TRUNCATION_EXPIRE_AFTER_SECONDS doesn't work HOT 7
- RDT. Action required? HOT 2
- Support Status of MongoDB HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fiware-sth-comet.