adlnet / xAPIWrapper

Wrapper to simplify communication to an LRS
https://adlnet.gov/projects/xapi/
Apache License 2.0
219 stars 114 forks source link

TypeError: urlparts is null when endpoint is set to http://127.0.0.1:8000 #113

Closed sir-sigurd closed 5 years ago

sir-sigurd commented 5 years ago

When endpoint is set to "http://127.0.0.1:8000", getStatements() appends "statements" to it, so URL becomes "http://127.0.0.1:8000statements" and this regexp doesn't match.

FlorianTolk commented 5 years ago

is the endpoint supposed to be "http://127.0.0.1:8000/statements? or where can you get your statements from for your lrs?

sir-sigurd commented 5 years ago

The correct endpoint is "http://127.0.0.1:8000/xapi", I used the wrong URL in https://github.com/adlnet/xapi-statement-viewer and had this TypeError again and again on page reload until I manually removed saved config from localStorage.

vbhayden commented 5 years ago

It looks like the readme already outlines proper LRS endpoint syntax:

conf['endpoint'] = "http://localhost:8000/xapi/";

Even if it didn't, I've seen some wrappers require the / and others omit it. /xapi/statements is the correct path for retrieving xAPI statements though, is there an issue here I'm not seeing?