#include <nng/nng.h> #include <nng/supplemental/http/http.h> int nng_http_server_add_handler(nng_http_server *s, nng_http_handler *h);
nng_http_server_add_handler - add HTTP server handler
nng_http_server_add_handler() adds the handler h to the server
If another handler is already added to the server that would conflict
with handler h, then the operation will fail with
If a handler is added to a server, and the server is subsequently deallocated, the handler and any of its resources will also be deallocated.
Handlers that are added to a server may be subsequently removed using the
This function returns 0 on success, and non-zero otherwise.
Handler conflicts with another handler.
Insufficient free memory exists.
HTTP not supported.