aboutsummaryrefslogtreecommitdiffstats
path: root/bindings/samples
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/samples')
-rw-r--r--bindings/samples/HelloWorld.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/bindings/samples/HelloWorld.c b/bindings/samples/HelloWorld.c
index 0b0d1a96..134ea620 100644
--- a/bindings/samples/HelloWorld.c
+++ b/bindings/samples/HelloWorld.c
@@ -428,6 +428,12 @@ static void appid (afb_req request)
free(aid);
}
+static void uid (afb_req request)
+{
+ int uid = afb_req_get_uid(request);
+ afb_req_success_f(request, json_object_new_int(uid), "uid is %d", uid);
+}
+
static int preinit()
{
AFB_NOTICE("hello binding comes to live");
@@ -468,6 +474,7 @@ static const afb_verb_v2 verbs[]= {
{ .verb="broadcast", .callback=broadcast },
{ .verb="hasperm", .callback=hasperm },
{ .verb="appid", .callback=appid },
+ { .verb="uid", .callback=uid },
{ .verb="exit", .callback=exitnow },
{ .verb=NULL}
};