# Mux.jl route vs page

**URL:** <https://discourse.julialang.org/t/mux-jl-route-vs-page/27431>\
**Category:** Web Stack\
**Created:** [August 11, 2019, 9:01pm UTC](https://discourse.julialang.org/t/mux-jl-route-vs-page/27431 "2019-08-11T21:01:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![milesf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/milesf/32/9289_2.png) [@milesf](https://discourse.julialang.org/u/milesf)\
**Post date:** [August 11, 2019, 9:01pm UTC](https://discourse.julialang.org/t/mux-jl-route-vs-page/27431/1 "2019-08-11T21:01:11Z")

</div>

I am trying to determine best practices for using `route` versus `page`, but don’t understand the differences between these two functions.

The [documentation](https://github.com/JuliaWeb/Mux.jl#utilities) describes `page` as being more strict with _exact_ request location matches, but I’m still trying to come up with an example of a request location and target path that matches with `route`, but not with `page`.

> route(“/path/here”, app) – branches to app if the request location matches “/path/here”.  
> page(“/path/here”, app) – branches to app if the request location _exactly_ matches “/path/here”

According to the code, it seems that this example needs a request location length that is different than the target length, but that still works with `matchpath!`.

> <https://github.com/JuliaWeb/Mux.jl/blob/b8419df8774c0ee14052320d22bab41b653d0c01/src/routing.jl#L38>

---

<div class="post-metadata">

**Author:** ![jballanc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jballanc/32/328_2.png) [@jballanc](https://discourse.julialang.org/u/jballanc)\
**Post date:** [August 20, 2019, 7:55pm UTC](https://discourse.julialang.org/t/mux-jl-route-vs-page/27431/2 "2019-08-20T19:55:58Z")

</div>

As I understand it, the difference between `route` and `page` is that `page` is intended to be terminal (or a “leaf”, if you prefer), whereas `route` can be used to nest `app`s within other `apps`.
