tarantool / http

Tarantool http server
Other
80 stars 39 forks source link

roles: introduce role for http servers #197

Closed DerekBum closed 2 months ago

DerekBum commented 2 months ago

This patch adds roles.http_server. This role allows to configurate one or more HTTP servers. Those servers could be reused by several other roles.

Servers could be accessed by their names (from the config).

get_server(name) method returns a server by its name. If nil is passed, default server is returned. The server is default, if it has DEFAULT_SERVER_NAME ("default") as a name.

This patch also adds a httpd:delete(name) method to delete named routes.

Closes #196

oleg-jukovec commented 2 months ago

Let's also add a public API call for this functionality in the scope of the task, so that there is no need to access internal structures directly:

https://github.com/tarantool/metrics-export-role/blob/36130b73c0a5975ff26f0c26f78ee7a368c1207b/roles/metrics-export.lua#L26-L37

DerekBum commented 2 months ago

Updated the PR according to the comments.

DerekBum commented 2 months ago

CI is finally green, all comments are fixed.

DerekBum commented 2 months ago

Updated the PR according to comments.

DerekBum commented 2 months ago

Updated everything according to comments.

DerekBum commented 2 months ago

Updated everything according to comments.