aboutsummaryrefslogtreecommitdiff
path: root/src/clog.c
blob: 74564f0f0b98e6a68c9319c16cc09cd45cefcf6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <kore/kore.h>
#include <kore/http.h>

#include "assets.h"

int page(struct http_request *);

int page(struct http_request *req)
{
	struct kore_buf *buf;
	buf = kore_buf_alloc();

	kore_buf_append(buf, asset_index_begin_html, asset_len_index_begin_html);
	kore_buf_append(buf, asset_index_end_html, asset_len_index_end_html);

	http_response_header(req, "content-type", "text/html; charset=utf-8");
	http_response(req, 200, buf->data, buf->offset);
	// http_response_stream ???
	kore_buf_free(buf);

	return (KORE_RESULT_OK);
}