Write a function.
You have a web server.
Serverino is an HTTP and WebSocket server for the D programming language. No dependencies, no framework to learn, nothing to install next to it: every request is handled by a plain function, in its own worker process.
import serverino;
mixin ServerinoMain;
void hello(Request request, Output output)
{
auto name = request.get.read("name", "world");
output ~= "Hello, " ~ name ~ "!";
}
That code is running right now
This website is a serverino application. The endpoint below lives in the same process that just sent you this page: press Run and you are calling it.
Every demo on this site works the same way. On the examples page you can also break one of its worker processes and watch the site carry on, see where the workers come from, or watch its memory move in real time over a WebSocket.
Small on the outside, careful on the inside
The API is a handful of functions and attributes. What is underneath is a process architecture designed so that your code cannot take the server down.
Zero dependencies
Only the D standard library. One executable of a few megabytes to deploy: no runtime, no package tree, nothing installed on the machine.
A process per request
Workers are separate processes. A segfault, a leak or an endless loop in one request costs you that request, not the server.
Fast, and cheap to keep running
epoll, kqueue or select, chosen for your platform. Idle, this whole site is a couple of processes and a few megabytes of memory — the demo above measures it.
Hot reload
Rebuild, send a signal, and workers restart with the new code. Connections already open are not dropped.
HTTPS, certificate included
Attach a certificate to a listener and reload it without restarting: an example here gets and renews its own from Let's Encrypt, with nothing in front of it.
WebSockets, not an add-on
Take a WebSocket instead of an Output and you are done.
Each connection gets its own process.
Three commands
You need a D compiler and dub. Nothing else.
dub init your_app -t serverino cd your_app dub run
That gives you a working server on http://localhost:8080. From there,
the documentation walks you through routing, forms, cookies,
WebSockets and HTTPS — or you can go straight to
thirteen complete examples.
Coming from an LLM-assisted workflow? Serverino ships
llms.txt and a full text reference meant to be pasted into a model's
context. Here is how to use them.
Enjoying it?
Serverino is MIT licensed and free to use, at work too: nothing to sign, nothing expected. It is written in spare time, for the pleasure of it — and if you feel like it, there is a beer button.