http_static: web app doc update
Type: docs
Change-Id: I0d3395c1de51c086b2ac68cd92c97efe36665b62
Signed-off-by: Matus Fabian <matfabia@cisco.com>
diff --git a/docs/usecases/webapp.rst b/docs/usecases/webapp.rst
index f76fd5b..43e6004 100644
--- a/docs/usecases/webapp.rst
+++ b/docs/usecases/webapp.rst
@@ -19,8 +19,7 @@
::
static int
- handle_get_status (http_builtin_method_type_t reqtype,
- u8 * request, http_session_t * hs)
+ handle_get_status (hss_url_handler_args_t *args)
{
my_main_t *mm = &my_main;
u8 *s = 0;
@@ -34,11 +33,11 @@
s = format (s, "}}");
/* And tell the static server plugin how to send the results */
- hs->data = s;
- hs->data_offset = 0;
- hs->cache_pool_index = ~0;
- hs->free_data = 1; /* free s when done with it, in the framework */
- return 0;
+ args->data = s;
+ args->data_len = vec_len (s);
+ args->ct = HTTP_CONTENT_APP_JSON;
+ args->free_vec_data = 1; /* free s when done with it, in the framework */
+ return HSS_URL_HANDLER_OK;
}
Words to the Wise: Chrome has a very nice set of debugging tools. Select
@@ -53,7 +52,7 @@
Step 2: Register URL handlers with the server
---------------------------------------------
-Call http_static_server_register_builtin_handler() as shown. It’s likely
+Call ``hss_register_url_handler`` as shown. It’s likely
but not guaranteed that the static server plugin will be available.
::
@@ -65,7 +64,7 @@
/* Look up the builtin URL registration handler */
fp = vlib_get_plugin_symbol ("http_static_plugin.so",
- "http_static_server_register_builtin_handler");
+ "hss_register_url_handler");
if (fp == 0)
{
@@ -259,7 +258,7 @@
::
- http static server www-root /myhugosite/public uri tcp://0.0.0.0/2345 cache-size 5m fifo-size 8192
+ http static server url-handlers www-root /myhugosite/public uri tcp://0.0.0.0/2345 cache-size 5m fifo-size 8192
The www-root must be specified, and must correctly name the compiled
hugo site root. If your Hugo site is located at /myhugosite, specify