PHPackages                             archict/router - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. archict/router

AbandonedArchivedArchict-brick[HTTP &amp; Networking](/categories/http)

archict/router
==============

Simple HTTP router

v1.1.0(1y ago)0624[5 PRs](https://github.com/Archict/router/pulls)2MITPHPPHP &gt;= 8.2CI passing

Since May 8Pushed 1y agoCompare

[ Source](https://github.com/Archict/router)[ Packagist](https://packagist.org/packages/archict/router)[ RSS](/packages/archict-router/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (18)Used By (2)

Archict/router
==============

[](#archictrouter)

[![Tests](https://github.com/Archict/router/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/Archict/router/actions/workflows/tests.yml)

Usage
-----

[](#usage)

This Brick allows you to setup route with a request handler and add some middleware. Let's see how to do that!

### A simple route ...

[](#a-simple-route-)

There is 2 way for creating a route: Having a whole controller class, or a simple closure.

First you need to listen to the Event `RouteCollectorEvent`:

```
