【发布时间】:2021-02-08 23:47:24
【问题描述】:
我正在尝试使用 Mojolicious 单线器向用户显示有关服务中断的消息。无论路线如何,我都希望显示消息。这是我从what's in the documentation 略微修改的内容。
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
匹配除/ 之外的所有路由。有没有办法匹配单个定义中的所有路由?
【问题讨论】:
-
这能回答你的问题吗? Match any GET path with Mojolicious::Lite
标签: perl mojolicious