Read the statement by Michael Teeuw here.
Testing my module, it is stuck loading
-
@sdetweil I’m going to try to fill it out like a template, let me know if I’m following.
let header = "", let original_url = "https://api.seatgeek.com/2/events?client_id=MYCLIENTID&client_secret=MYCLIENTSECRET " let cors_url = "http://" + config.address==="IP ADDRESS HERE"?"localhost":config.address + ":" + config.port + "/cors?" + header + "&url=" + original_url
and then I
fetch(cors_url)
?Is this right?
-
@l0zarus said in Testing my module, it is stuck loading:
Is this right?
yes
almost …
"IP ADDRESS HERE"
MUST be
"0.0.0.0"
(which is the MM value for listen on any network adapter)
-
```
// this next block is to deal with a CORS permissions issue with the API
let header = “”;// this is the API call url let original_url = "http://api.seatgeek.com/2/events?lat=" + self.config.latitude + "&lon=" + self.config.longitude + "&per_page=" + self.config.eventCount + "&datetime_utc.gte=" + today + "&datetime_utc.lte=" + oneweek + "&range=" + self.config.range + "&type=concert" + "&client_id=" + self.config.clientID + "&client_secret=" + self.config.clientSecret; // this is the cors URL let cors_url = "http://" + config.address==="0.0.0.0"?"localhost":config.address + ":" + config.port + "/cors?" + header + "&url=" + original_url;
-
@l0zarus looks good
-
@sdetweil I got a new console error:
-
@l0zarus you did NOT add let config= right? (or var, or const)
config is already defined for you
this.config is the stuff from your module entry
config. is ALL the config.js -
I added let header = “” and let cors_url = jdhflrkgd. I did not add anything else at all.
exact code below:
let header = ""; // this is the API call url let original_url = "http://api.seatgeek.com/2/events?lat=" + self.config.latitude + "&lon=" + self.config.longitude + "&per_page=" + self.config.eventCount + "&datetime_utc.gte=" + today + "&datetime_utc.lte=" + oneweek + "&range=" + self.config.range + "&type=concert" + "&client_id=" + self.config.clientID + "&client_secret=" + self.config.clientSecret; // this is the cors URL let cors_url = "http://" + config.address==="0.0.0.0"?"localhost":config.address + ":" + config.port + "/cors?" + header + "&url=" + original_url; // fetching the data from seatgeek fetch(cors_url)
-
strange… I just found the following code at the top of my file. I did not add it there. Going to delete it now.
const config = require("../../config/config");
-
@l0zarus said in Testing my module, it is stuck loading:
config.address===“0.0.0.0”?“localhost”:config.address
oops
need parens around that… -
@sdetweil aha!!! This did it! It’s ugly but it is working… now to spend time improving the design of the table and make my code more effective.
THANK YOU SO MUCH! I will probably be back with more questions, but not around this issue.