1  What is Ambiorix?

Ambiorix is a server-side framework for building web applications and APIs in R.

It provides routing, request/response handling, middleware, and tooling that make it possible to build modern web backends without leaving the R ecosystem.

Its syntax is inspired by the popular JavaScript framework express.js, offering a simple & minimal style for defining routes and application logic.

Ambiorix is powered by the httpuv package, which provides the underlying HTTP server. Ambiorix sits on top of {httpuv} to offer a more ergonomic and expressive interface for building web services.

Ambiorix emphasizes:

At its core, Ambiorix gives you a lightweight but powerful toolkit for turning your R logic into HTTP endpoints.

1.1 Where Ambiorix Fits

If you’ve built anything for the web in R, you’ve likely used Shiny. Shiny is excellent at what it does – reactive, single-page applications with tight coupling between UI and server logic.

Ambiorix operates in different territory. It gives you direct control over HTTP: you define routes, handle requests, and create responses yourself. There is neither a reactivity layer, nor an implicit UI binding. You decide what goes where.

This makes Ambiorix a natural choice when you need:

  • REST APIs that serve JSON to other applications.
  • Multi-page applications with server-rendered HTML.
  • WebSocket-based services where you control the protocol.
  • Lightweight backends that sit behind a modern JavaScript frontend.

If you’re familiar with Express.js or Python’s Flask, Ambiorix will feel familiar. If Shiny is the only web framework you’ve used in R, you’ll find the mental model here quite different – and that’s the point. We cover this in more detail in The web, frameworks, and R.

1.2 Installation

Get the stable version from CRAN:

install.packages("ambiorix")

If you like to live on the edge, feel free to install the development version from github:

devtools::install_github(repo = "ambiorix-web/ambiorix")