Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jkuhlmann/bbhttpd
Barebones HTTP daemon to drop into your project
https://github.com/jkuhlmann/bbhttpd
Last synced: 5 days ago
JSON representation
Barebones HTTP daemon to drop into your project
- Host: GitHub
- URL: https://github.com/jkuhlmann/bbhttpd
- Owner: jkuhlmann
- Created: 2013-08-22T20:59:15.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-09-02T20:39:59.000Z (about 11 years ago)
- Last Synced: 2023-04-01T08:23:26.170Z (over 1 year ago)
- Language: C
- Size: 121 KB
- Stars: 13
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
bbhttpd - The barebones HTTP daemon
===================================A HTTP server that can easily be dropped into your existing project to help with debugging and development.
Features
--------
- Only one source file and one header file. Just drop the files into your project, no need to build a library and link to it.
- No unnecessary features. You get the HTTP request and send back a response.
- C89-compliant C code
- MIT licenseUsage
-----```c
#include "bbhttpd.h"bbhttpd_config_t config = BBHTTPD_CONFIG_INIT;
bbhttpd_t* bbhttpd = bbhttpd_start(&config);while (!do_exit)
{
bbhttpd_request_t* request = bbhttpd_get_request(bbhttpd);
if (request)
{
const char* test_response = "Hello, world!";
bbhttpd_response_t response;
response.status = 200;
response.body = test_response;
response.body_length = strlen(test_response);
bbhttpd_send_response(bbhttpd, request, &response);
}
}bbhttpd_stop(bbhttpd);
```