# Yaws\_appmod\_router - bring routing to Yaws

**URL:** <https://erlangforums.com/t/yaws-appmod-router-bring-routing-to-yaws/4390>\
**Category:** Libraries\
**Tags:** yaws, erlang\
**Created:** [January 15, 2025, 1:18pm UTC](https://erlangforums.com/t/yaws-appmod-router-bring-routing-to-yaws/4390 "2025-01-15T13:18:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![etnt](https://erlangforums.com/user_avatar/erlangforums.com/etnt/32/892_2.png) [@etnt](https://erlangforums.com/u/etnt)\
**Post date:** [January 15, 2025, 1:18pm UTC](https://erlangforums.com/t/yaws-appmod-router-bring-routing-to-yaws/4390/1 "2025-01-15T13:18:33Z")

</div>

yaws\_appmod\_router is a Yaws appmod that try to bring (URL path) routing to Yaws.

Example:

```erlang
    %% Route handler with no middleware.
    yaws_appmod_router:add_route("GET", "/", fun simple:root/1, []),
    yaws_appmod_router:add_route("GET", "/hello", fun simple:hello/1, []),

    %% Below we will do the authentication in the Middleware,
    %% just before the out/1 route handler is invoked.
    yaws_appmod_router:add_route("GET", "/user/:id", fun simple:user/1, [
        fun simple:authenticate/1
    ]), 

```

Note: Despite several working examples provided, yaws\_appmod\_router has not (yet) been tested in a real product, so beware of this fact.

Read about it here:

> **[GitHub - etnt/yaws\_appmod\_router: Yaws route handling](https://github.com/etnt/yaws_appmod_router)**
>
> Yaws route handling
