handy-httpd 7.8.0

Extremely lightweight HTTP server for D.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

handy-httpd

An extremely lightweight HTTP server for the D programming language.

Features

  • HTTP/1.1
  • Web Sockets (experimental)
  • Worker pool for request handling
  • Simple configuration
  • High performance
  • Beginner friendly
  • Extensible with custom handlers, exception handlers, and filters
  • Well-documented
  • Prioritises testability
  • Ships with some handy pre-made request handlers:
    • Serve static files with the FileResolvingHandler
    • Apply filters before and after handling requests with the FilteredHandler
    • Handle complex URL paths, including path parameters and wildcards, with the PathDelegatingHandler

Simple Example

import handy_httpd;

void main() {
	new HttpServer((ref ctx) {
		if (ctx.request.url == "/hello") {
			ctx.response.writeBodyString("Hello world!");
		} else {
			ctx.response.setStatus(HttpStatus.NOT_FOUND);
		}
	}).start();
}
Authors:
Dependencies:
slf4d, streams, httparsed
Versions:
8.4.0 2024-Apr-16
8.3.2 2024-Feb-16
8.3.1 2024-Feb-14
8.3.0 2024-Jan-30
8.2.0 2024-Jan-27
Show all 71 versions
Download Stats:
  • 6 downloads today

  • 35 downloads this week

  • 249 downloads this month

  • 19385 downloads total

Score:
4.1
Short URL:
handy-httpd.dub.pm