Documentation · Getting started

Introduction

Welcome to Routix — a high-performance HTTP router and small framework for Go.


Routix is built around a hand-tuned radix tree for routing, with an API that takes its cues from Express on the JS side and Laravel on the PHP side. The goal is the short version: a server that’s fast in production and pleasant in your editor.

It’s designed for the things most teams actually ship — JSON APIs, microservices, BFFs, and the back end of a small app. It is not trying to be a magic batteries-everywhere framework. It comes with the parts that hurt most when missing, and stays out of your way for the rest.

Radix-tree routing

Lookups in tens of nanoseconds. Zero allocation in the hot path.

An API you can guess

r.GET, r.Group, c.JSON. No wrappers around wrappers.

Middleware that compose

CORS, recovery, structured logger, rate limiter — opt in per route.

Production posture

Graceful shutdown, panic recovery, request IDs, structured logs.

Core features

Routix exposes a small surface that covers the boring 90% of what an HTTP service needs:

Router

  • Radix-tree match — routes resolve via prefix, no regex on hot paths.
  • Middleware chains — composed top-to-bottom, no hidden order.
  • Groups — share prefixes and middleware (/api/v1, /admin).
  • Params — typed, never panics on missing keys.
  • Response helpers — JSON, redirect, stream, file, status-only.

CLI

The CLI is opt-in. If you want a project skeleton, generators, or hot reload, install routix/cli and use it. If you don’t, the router stands alone.

  • routix new — project scaffold with handlers, middleware, .env.
  • routix make:controller — code generators for controllers, models, middleware.
  • routix serve --watch — hot reload during development.
  • routix migrate — run/rollback database migrations when you opt into the storage layer.

Philosophy

Batteries included, but removable. Routix gives you the things you would otherwise spend a week reinventing — router, CLI, middleware — without locking you into a stack. There’s no opinion on your database, your ORM, your serializer, or your deploy target.

Things that are hard to add later (graceful shutdown, panic recovery, structured logs) ship by default. Things that are easy to add later (sessions, queues, view rendering) live in separate modules.

Next

Up next — install the module and write the three lines that get you to 200 OK.

Installation guide