[openlp-dev] Remote API changes and web remote code

Simon Hanna simon at hannaweb.eu
Sun Aug 19 16:52:27 EDT 2018


Hi everyone,

so here is what I think about how the API should look like.

  * Requests that change state should be POST (add items to service,
    send live, show next|previous slide|item, show desktop|black|..., ...)
  * The parameters that are sent with the requests should _not_ be in
    json. They are currently always a number or a string. This should be
    either a simple GET parameter (?param=value) or when appropriate in
    a POST request
  * Requests that result in actions that don't need to return anything,
    should return an empty response on success with a 2XX status Code
      o Failures should have a proper error code (4XX or 5XX) and
        contain a json string in the body { "text": "some text
        describing the error" } (the key could also be "error" or
        anything else really) and maybe other relevant information under
        other keys
  * Requests that return data should return the data in the top level of
    the json string so { data } and not { "key": data } if they only
    return one object or a list (currently always the case)

I have created a kanban board for this, as to not clutter the general
board. It's available here
https://kanban.openlp.io/b/MQvnWRGeMiF6mbmeL/remote-api-changes

It's a public board, and if you want to say something about the
requested changes, just provide me with your details, so I can add you.
I have labelled them with either low priority (green) or high priority
(red). I don't regard my last point mentioned above as that important,
but I really think the request data shouldn't be handled like it's
currently done.

 The angular project lives in a GitLab repository here
https://gitlab.com/thelinuxguy/openlp-remote

The master branch is still the old (working) version running an older
version of angular, while the angular-6 branch
(https://gitlab.com/thelinuxguy/openlp-remote/tree/angular-6) is the
version I'm currently working on which doesn't work yet. The UI renders,
but no interaction with OpenLP has been tested yet...

If you want to give it a spin, download it, run "yarn install" followed
by a "ng serve" to get it up. If you want to contribute to that, merge
requests are welcome, or just create issues or email me if you don't
have/want to create an account over at GitLab.


cheers,

Simon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openlp.io/pipermail/openlp-dev/attachments/20180819/7cb272bc/attachment.html>


More information about the openlp-dev mailing list