FAQ
HTTP adapter
Which web server engine to use, and how to switch.
The question: Kest can run on more than one web server. Which should I use, and what changes when I switch?
An engine is the web server library underneath Kest. There are two, and your application code is the same on both: controllers, guards, pipes, filters and middleware do not know which engine runs them (Platform agnosticism).
NettyHttpAdapter | JdkHttpAdapter | |
|---|---|---|
| use for | production | tests, small tools, services with few dependencies |
| HTTP/2, TLS options | yes | no |
| WebSockets and Socket.IO, GraphQL subscriptions | yes | no |
@NonBlocking fast path | yes | no |
| extra dependencies | Netty | none (the JDK's built-in server) |
Switching changes one line:
app.http(NettyHttpAdapter(8080)) { ... } // production
app.http(JdkHttpAdapter(8080)) { ... } // tests: JdkHttpAdapter(0) picks any free portRoutes, guards, pipes and filters are identical. Differences: HTTP/2, WebSocket, Socket.IO and the @NonBlocking fast path are Netty-only. If you use any of those, use Netty everywhere, including in tests, so tests match production.
Both engines pass the same test suite, so choose by features, not by fear of differences. See HTTP adapters for every setting (body limit, idle timeout, HTTP/2, TLS) and Platform agnosticism for writing your own.