A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
Node-helper Access-Control-Allow-Origin
-
Hello, I get always this error “CORS-Kopfzeile ‘Access-Control-Allow-Origin’ fehlt)”
how is it possible the manage the node-helper.js to solved this error?
the node-helper.js:
const NodeHelper = require("node_helper"); const https = require("https"); const express = require("express"); const app = express(); const cors = require('cors'); module.exports = NodeHelper.create({ start: function () { console.log("MMM-Cryptocurrency loaded!"); }, socketNotificationReceived: function (notification, payload) { if (notification === "get_ticker") { this.getTickers(payload); } }, getTickers: function (payload) { var self = this; https .get(payload.url, (res) => { let data = ""; res.on("data", (chunk) => { data = data + chunk.toString(); }); res.on("end", () => { self.sendSocketNotification("got_result", { id: payload.id, data: JSON.parse(data) }); }); }) .on("error", (err) => { console.log("MMM-Cryptocurrency error: ", err.message); }); } });
thanks guys
-
@fischi87 there is a new mm service to help get around this coming in next release.
it’s in the develop branch now.
see this on how to get develop
see here for the new feature
https://github.com/MichMich/MagicMirror/issues/2714#issuecomment-1024627426 -
this post ist more than 1 Jahr ago !
-
@fischi87 so? same instructions work today. I don’t have to type them again
-
ist still dosent work, a other idea? how is it possible to write it in this node_helper.js?
-
@fischi87 yes, but I don’t know how