To get the regular API Endpoint we were using
repoApiUrl = serverUrl + scriptPath + '/api.php',
Probably replacing api.php with rest.php should work as well. However, I wonder if there is a more elegant way.
To get the regular API Endpoint we were using
repoApiUrl = serverUrl + scriptPath + '/api.php',
Probably replacing api.php with rest.php should work as well. However, I wonder if there is a more elegant way.
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Physikerwelt | T208758 Display popups for annotated <math> tags without touching popups extension code | |||
Resolved | ovasileva | T233099 [For visibility] Page previews should be externally extendable | |||
Resolved | Physikerwelt | T290710 How to get the location of MWRestAPI from js |
So the way we do this in other repos is having a configurable API URL.
e.g. https://github.com/wikimedia/Vector/blob/master/skin.json#L257 (see also Popups endpoint )
One of the benefits of this is you can point to a production API from your localhost. Deriving it from wgServer etc means whoever is testing locally must set up a RESTbase instance to test.
@Jdlrobson thank you.
In
https://github.com/wikimedia/Vector/blob/0a47c667d83443e93c1fafcf57b9ba677b520a01/skin.json#L257
I see that you set an empty default. However, I was wondering where do I get the default value for the current rest.php. If I start to construct the path in the math extension any changes to the default path of rest.php will have to be applied in parallel to MW-core and the math extension. Conventions like that caused headaches in the past, thus I would want to avoid that in the future.
I'm still a bit confused. Why can't you follow the approach for $wgPopupsRestGatewayEndpoint here?
Removing inactive assignee (Platform Engineering: Please unassign tasks of previous team members.)