Skip to content

REST addon: allow users to implement custom additional routes#1945

Draft
ludolpif wants to merge 6 commits intoSanderMertens:masterfrom
ludolpif:pr-rest-make-routing-public
Draft

REST addon: allow users to implement custom additional routes#1945
ludolpif wants to merge 6 commits intoSanderMertens:masterfrom
ludolpif:pr-rest-make-routing-public

Conversation

@ludolpif
Copy link
Copy Markdown
Contributor

Hi,
As briefly discussed on FLECS discord, I choosen AGPL on my current fun project (LLSS, a mockup of a OBS-like streaming software, based on game-oriented libraries) and, as it is in early development stages, I want to:

  • comply with the licence that explicitly ask to publish source-code through provided network services
  • not replace the (minimal and flawky) embed FLECS http server for now

This leads me to try to add a route like "/sources" in the REST API, keeping the others intact. It seems this needs to make a few rest.c functions public, at least: flecs_rest_reply() but flecs_reply_error() and flecs_rest_server_garbage_collect() seems to be very useful also.

Here is my first draft of this. What is done:

  • on flecs side: make flecs_rest_reply() public and don't force private_desc.callback = flecs_rest_reply; in flecs_rest_reply()
  • a bad and working first example of using this, in example/c/rest

If you still think it could be fine to go for it, could you provide some feedback on this to show me a good way to improve it ?
Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant