aboutsummaryrefslogtreecommitdiff
path: root/examples/template-demo/main.c
diff options
context:
space:
mode:
authorfrosty <gabriel@bwaaa.monster>2026-03-12 18:13:04 -0400
committerfrosty <gabriel@bwaaa.monster>2026-03-12 18:13:04 -0400
commit4722542caf4192fe702adc975e8ee557e3526426 (patch)
treea9419dea2815652f3f53ab8d90009774494883fc /examples/template-demo/main.c
parentec82c9ec4eb40ba28c228414e501d73ecc5326af (diff)
downloadbeaker-4722542caf4192fe702adc975e8ee557e3526426.tar.gz
feature: added conditionals + added examples
Diffstat (limited to 'examples/template-demo/main.c')
-rw-r--r--examples/template-demo/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/template-demo/main.c b/examples/template-demo/main.c
index 2adbb52..9989a68 100644
--- a/examples/template-demo/main.c
+++ b/examples/template-demo/main.c
@@ -26,6 +26,10 @@ int templating_handler(UrlParams *params) {
context_set(&ctx, "safe_html", "This is <b>bold</b> and <i>italic</i> HTML.");
context_set(&ctx, "unsafe_html", "<script>alert(0);");
+ context_set(&ctx, "user_logged_in", "true");
+ context_set(&ctx, "role", "admin");
+ context_set(&ctx, "status", "active");
+
char *features[] = {"Fast and Lightweight", "Simple API",
"Basic Routing", "Templating Engine",
"Static File Serving", "Cookie Management"};