Topic on Project:Support desk

cannot access pages from RESTBase server

3
Scejja (talkcontribs)

I've just installed RESTBase server with this config.yaml

       ...
       paths:
         /{domain:127.0.0.1:8081}:
         ...
               apiUriTemplate: http://127.0.0.1:8081/mediawiki/api.php
               baseUriTemplate: "{{'http://{domain}:7231/{domain}/v1'}}"
             parsoid:
               host: http://localhost:8142
             table:
               backend: sqlite
               dbname: db.sqlite3
               ...

I'm using

Mediawiki 1.30 , PHP 7.0.22, MySQL 5.7.21, ubuntu0.16.04.1

When I make

curl http://127.0.0.1:7231/127.0.0.1:8081/v1/

I get

{"items":["page","transform"]}

And with

http://127.0.0.1:7231/127.0.0.1%3A8081/v1/page/

I get

{"items":["data-parsoid","html","title","wikitext"]}

And in browser I get to "Wikimedia REST API".

But if I try to get some wiki page using the API wiki I get 404

For example:

curl -X GET --header 'Accept: application/problem+json' 'http://127.0.0.1:7231/127.0.0.1%3A8081/v1/page/html/P%C3%A1gina_principal'

{

  "type": "https://mediawiki.org/wiki/HyperSwitch/errors/not_found",

  "title": "Not found.",

  "method": "get",

  "uri": "/127.0.0.1%3A8081/v1/page/html/P%C3%A1gina_principal"

}

I have short URLs enabled, so main page is:

http://127.0.0.1:8081/wane/P%C3%A1gina_principal

Any help please?

Ciencia Al Poder (talkcontribs)

A path of /{domain:127.0.0.1:8081}: is probably not going to work.

Your wiki should be published somewhere with a domain name. Or at least try to use a wiki identifier for that and use it as the "domain" configuration

$wgVirtualRestConfig['modules']['restbase'] = [
  'url' => "http://127.0.0.1:7231",
  'domain' => 'yourdomain',
  'parsoidCompat' => false
];
Scejja (talkcontribs)

That was the problem, for the moment, if I put 'localhost' for domain property in config.yaml (the same as in parsoid and VisualEditor configuration) it works.

Thanks a lot for your help!