[pbs-devel] [PATCH proxmox-backup] examples: add example for a simple rest server with a small api

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Sep 27 09:15:16 CEST 2021


On 22.09.21 13:05, Dominik Csapak wrote:
> show how to generally start a daemon that serves a rest api + index page
> 
> api calls are:
> /		GET	listing
> /ping		GET	returns "pong"
> /items		GET	lists existing items
> 		POST	lets user create new items
> /items/{id}	GET	returns the content of a single item
> 		PUT	updates an item
> 		DELETE	deletes an item
> 
> Contains a small dummy user/authinfo
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  examples/rest_server.rs | 219 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 219 insertions(+)
>  create mode 100644 examples/rest_server.rs


looks OK, I like that it's really not much code!

But, I'd like to have this as example in the rest-server crate and not in the top-level
proxmox-backup crate thingy, as we know that we do not want to keep that as crate but
only as plain workspace and the example also better fits into rest-server.

Currently we'd only need to move the `proxmox_backup::tools::async_io::StaticIncoming`
(together with some other tokio adapters) in a new crate to solve that, maybe Dietmar
or Wolfgang have already a concrete idea/plan for that.





More information about the pbs-devel mailing list