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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login