MDAN MDAN Docs
Site

Server Integration

This page is for the case where you already have a backend and want to plug MDAN into it without rebuilding the runtime yourself.

The short version is: do a thin HTTP adaptation layer, then let the runtime handle the real work.

Integration Boundary

Keep the boundary clear:

In practice, that means adapting requests and responses to server.handle(), not re-implementing MDAN logic in middleware or controllers.

A Typical Adapter Shape

Reference: examples/express-starter/app/express-adapter.ts

Using Express as an example, the adapter only needs to do a few things:

So the adapter is only translating the framework world into a runtime request, then translating the runtime result back into a framework response.

How The App Registers Operations

Reference: examples/express-starter/app/server.ts

Application-side action registration should stay explicit:

Do not infer bindings from what the page currently renders. What the page declares and what the server registers should line up directly.

HTTP Semantics You Need To Preserve

You do not need to manually handle these rules in every business handler, but the adaptation layer must not lose them.

Adapter Checklist

Common Pitfalls