yaws_appmod_router is a Yaws appmod that try to bring (URL path) routing to Yaws.
Example:
%% 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: