Open glorieux-f opened 10 months ago
Dear @glorieux-f and @tnajdek,
I run into a similar problem: the current zotero-webapp implementation allows to configure the apiAuthorityPart in index.html, like below. But how is it possible to change the API path of the API server ? So, e.g., in the case of @glorieux-f , how would I set https://www.unige.ch/piaget/api/ as the route to the zotero API endpoint ? (We do not want to set up a second domain, just for the zotero server).
Thanks and merci !
<script type="application/json" id="zotero-web-library-config">
{
"userSlug": "zotero-user",
"userId": "475425",
"apiConfig": {
"apiAuthorityPart": "api.zotero.org"
},
"libraries": {
"include": [
{
"key": "g729",
"name": "All Things Zotero",
"isGroupLibrary": true
}
],
"includeMyLibrary": true,
"includeUserGroups": false
}
}
</script>
I tried "apiAuthorityPart": " https://www.unige.ch/piaget/api/ "
, but this does not work - it only changes - as the name implies- the Authority Part, but does not care about the rest - so if the API is at "https://www.unige.ch" this would work, but it is ugly - esp. if one wants to serve the zotero-webapp from this URL or a subpath like in the case above.
I also could not find the location in the webapp code, where this is processed to understand, how apiAuthorityPart is used.
The Zotero web-library has been elected by our team as the best webapp to publish a bibliography (the killer feature is the export in any desired style). Under an university website, it’s usually not possible to have a root server. So the Zotero webapp has to be installed in a subfolder. Here is the official bibliography of the psychologist Jean Piaget (available also as a public zotero group).
https://www.unige.ch/piaget/biblio/
Most of what we need works very well, but routing is a big problem. The Zotero react app use absolute path only, like https://www.unige.ch/groups/5024983/piaget_enop/items/V2F26IMG/library, going away from its assigned folder. Of course our sysadmins will not support such urls, so they are not stable.
React-router is supposed to support the attribute BrowserRouter/@basename to ensure a prefix to all urls in the app. Of course if this feature is quite new, developers have not use it in the past (not necessary under zotero.org), but, is it in your projects to make the “web-library” more portable? If yes, what kind of approach did you consider, especially to pass such parameter?
Tanks for any clue to follow zotero directions, even a bit in advance, so that syncing our fork will be less painfull.