aboutsummaryrefslogtreecommitdiff
path: root/examples/hi.c
blob: 9305ad5227c9c69981edeb4a455f6021aceda3e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}