# `AshTypescript.TypedController.Route`
[🔗](https://github.com/ash-project/ash_typescript/blob/v0.17.3/lib/ash_typescript/typed_controller/route.ex#L5)

Behaviour for typed controller route handlers.

Implement this behaviour for handler modules passed to `run:` in the DSL.
The handler receives the conn and a map of normalized params, and must
return a `%Plug.Conn{}`.

## Example

    defmodule MyApp.LoginHandler do
      @behaviour AshTypescript.TypedController.Route

      @impl true
      def run(conn, params) do
        # Handle login...
        Plug.Conn.send_resp(conn, 200, "OK")
      end
    end

Then in the DSL:

    route :login, method: :post, run: MyApp.LoginHandler do
      argument :code, :string, allow_nil?: false
    end

# `run`

```elixir
@callback run(Plug.Conn.t(), map()) :: Plug.Conn.t()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
