maxlath/wikibase-sdk

Support non-default script path

lucaswerkmeister opened this issue · 2 comments

Currently, the library assumes that the action API endpoint is found under /w/api.php, i.e. that the script path is /w:

instanceRoot = instance
.replace(/\/$/, '')
.replace('/w/api.php', '')
instanceApiEndpoint = `${instanceRoot}/w/api.php`

This is not true for all wikis, and I think the library would be more universally useful if it supported other wiki setups as well. (For instance, I have several development wikis locally, with script paths /wiki1, /wiki2, etc.)

Also:

return `${instance}/w/index.php?title=Special:EntityData/${id}.json&revision=${revision}`

solved by #78