Open alekseykravetz opened 6 years ago
I ran into the same problem, but instead I used the config variable in /node-media-server/node_http_server.js
app.all(['/api*'], (req, res, next) => { res.setHeader('Access-Control-Allow-Origin', this.config.http.allow_origin); next(); });
I share it in case someone find this useful https://github.com/henryContreras/Node-Media-Server/commit/e3b7c8e91cce08e9dbdeded670bb8cf58d9f4fa2
Hi,
I'm trying access Node-Media-Server API (http://{my-server}:8000/api/server) and I get CORS problem.
I could fix the issue if i'm adding the following line:
res.header('Access-Control-Allow-Origin', '*');
atapi\controllers\server.js
at line 111, but I'm pretty sure that it should be exposed anyway? Is there a way of exposing it through configuration?Thanks