From 4af132cf6adeeeeb5d6764c378bec2d05cad042f Mon Sep 17 00:00:00 2001 From: frosty Date: Sun, 28 Dec 2025 03:26:05 -0500 Subject: Migrated from GitHub --- examples/hello-world/main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 examples/hello-world/main.c (limited to 'examples/hello-world/main.c') diff --git a/examples/hello-world/main.c b/examples/hello-world/main.c new file mode 100644 index 0000000..bf3c8b0 --- /dev/null +++ b/examples/hello-world/main.c @@ -0,0 +1,20 @@ +#include +#include +#include + +int hello_world_handler(UrlParams *params) { + send_response("Hello, World!"); + return 0; +} + +int main() { + set_handler("/", hello_world_handler); + int result = beaker_run("127.0.0.1", 8080); + + if (result != 0) { + fprintf(stderr, "[APP] Error: Beaker server failed to start.\n"); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} -- cgit v1.2.3