我正在尝试使用Mojolicious单线程向用户显示关于服务中断的消息。无论路线如何,我都希望显示该信息。这是我从what's in the documentation稍微修改了一下。如何在Mojolicious中匹配所有路线?
perl -Mojo -E 'a("/" => {text => "The service is down for maintenance."})->start' daemon
这适用于/
,但没有其他任何东西。我添加了一个星号将其变成通配符路由。
perl -Mojo -E 'a("/*" => {text => "The service is down for maintenance."})->start' daemon
它匹配除了/
以外的所有路由。有没有办法在单一定义中匹配所有路线?