C語言的Web框架 Raphters

openkk 12年前發布 | 49K 次閱讀 C語言 Web框架

Raphters 是一個C 語言的Web框架,基于 RAPHT 架構模式。

示例代碼:

#include "raphters.h"

START_HANDLER (simple, GET, "simple", res, 0, matches) {
    response_add_header(res, "content-type", "text/html");
    response_write(res, "hello world");
} END_HANDLER

START_HANDLER (default_handler, GET, "", res, 0, matches) {
    response_add_header(res, "content-type", "text/html");
    response_write(res, "default page");
} END_HANDLER

int main() {
    add_handler(simple);
    add_handler(default_handler);
    serve_forever();
    return 0;
}

項目主頁:http://www.baiduhome.net/lib/view/home/1330773083874

 本文由用戶 openkk 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!