Skip to content

jkuhlmann/bbhttpd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 license

Usage

#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);

About

Barebones HTTP daemon to drop into your project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages