• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

missing 'Access-Control-Allow-Origin'

Scheduled Pinned Locked Moved Troubleshooting
10 Posts 6 Posters 5.6k Views 5 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    Bangee Module Developer
    last edited by Jul 20, 2016, 7:00 AM

    After googleing 1000 different websites I’ve used the nood_helper.js solution.

    And to load the nood_helper.js I had to restart electron. pm2 restart mm
    that coast me another hour to find out why it was no loading :-):gun: :hammer:

    1 Reply Last reply Reply Quote 0
    • K Offline
      KrawallKurt
      last edited by May 11, 2017, 4:54 PM

      I am facing the same problem. Could you please give an example, how you used node_helper.js to circumvent the access-allow-origin policy?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • Y Offline
        yawns Moderator
        last edited by May 11, 2017, 8:20 PM

        Like here for example:
        https://github.com/yawnsde/MMM-RNV

        You use request instead.

        1 Reply Last reply Reply Quote 0
        • K Offline
          KrawallKurt
          last edited by KrawallKurt May 11, 2017, 9:00 PM May 11, 2017, 8:46 PM

          Thank you!

          And why does it have to be in node_helper, not in the main script? Sorry, if this question sounds stupid, I’m new to developing modules.

          Also, is there a reason for declaring var self = this; and using self.func instead of this.func? I have seen this quite a bit and couldn’t understand why people do this…

          Y 1 Reply Last reply May 12, 2017, 8:47 AM Reply Quote 0
          • Y Offline
            yawns Moderator @KrawallKurt
            last edited by May 12, 2017, 8:47 AM

            @KrawallKurt
            Please note I am not an experienced javascript developer either. When using addon modules/libraries like request you use the node_helper.js to load this library. I am not sure if it is not possible at all to do so in the main module file or if it is just complicated. Maybe @strawberry-3-141 can clarify :)

            self = this was used in other modules and I added it to my module as well, because I did not want to possibly break something by leaving it out. There is a lot of discussion on the web why this is used and if this still should be used.

            1 Reply Last reply Reply Quote 0
            • K Offline
              KrawallKurt
              last edited by May 12, 2017, 11:14 AM

              Concerning the self=this question, I found a neat article giving som explanations: https://alistapart.com/article/getoutbindingsituations

              The other question: Could it be, that node_helper is executed on the server and the main script is executed on the client?

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy