diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2021-01-08 00:43:37 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2021-01-08 00:43:37 +0300 |
commit | 26e703e68a0324e7e5bfd3442f3e424c88dd2c42 (patch) | |
tree | 59302c86415f72fd48cf53c74489ea39c6df7153 /examples | |
parent | 7d0b4ad61ee1e150c76b9997971582066529b72a (diff) | |
download | magi-26e703e68a0324e7e5bfd3442f3e424c88dd2c42.tar magi-26e703e68a0324e7e5bfd3442f3e424c88dd2c42.tar.xz magi-26e703e68a0324e7e5bfd3442f3e424c88dd2c42.zip |
Documentation update started.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/hi.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/hi.c b/examples/hi.c new file mode 100644 index 0000000..9305ad5 --- /dev/null +++ b/examples/hi.c @@ -0,0 +1,16 @@ +#include <magi.h> +#include <stdio.h> + +int main() +{ + struct magi_request request; + magi_request_init(&request); + if (magi_parse(&request)) { + magi_response_default(); + puts("<html><head><title>Hi!</title></head><body>Hi!</body></html>"); + } else { + magi_error_response(request.error); + } + magi_request_free(&request); + return 0; +} |