# bramus/router

A lightweight and simple object oriented PHP Router

Repository: https://github.com/bramus/router
Canonical: https://ross.abutalabs.com/products/bramus-router
Language: PHP
License: MIT
License Family: permissive
Topics: php, routing
Last push: 2024-03-12T19:08:04+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4896, "days_push": 904, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1126, forks 237 (observed 2026-08-28T04:03:41.238307+00:00)

## What it is
A lightweight, object-oriented HTTP router library for PHP that maps request methods and URL patterns to callbacks. It supports static and dynamic (PCRE or placeholder) route patterns, middleware, subrouting, and custom 404 handling.

## Use cases
- route http requests in a php application
- define rest endpoints with get post put delete
- add before and after middleware to routes
- mount subroutes under a prefix
- handle 404s with custom logic
- build a small php api without a full framework

## When to choose
- you need a minimal router for a php site or micro-API without a heavy framework
- you want simple pattern-based routing with optional middleware
- your app runs in a subfolder and needs subfolder support

## When to avoid
- you need a full framework with ORM, templating, and auth built in
- you need async or non-PHP routing
- you require advanced features like automatic route caching or PSR-15 middleware

## Facets
- artifact type: library
- maturity: stable
- function: routing, middleware, http-server
- domain: web-development, backend, apis
- platform: php, self-hosted
- tags: php-router, rest-routing, microframework, http-methods, url-rewriting, web-server

## Member repositories
- bramus/router (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:41.238307+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:39:11.607373+00:00, confidence not recorded.
  - readme: https://github.com/bramus/router (fetched 2026-08-28T04:03:41.238307+00:00, sha 69eba44096e2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
