Вы допустили ошибку в своих маршрутах. Посмотрите на это демо-репозиторий Bidi:
https://github.com/io-tupelo-demo/bidi
Код в строке 16 из tst.demo.core
показывает, что происходит. В bidi
маршрут "/index.html" не включает вырожденный маршрут "/":
(let [routes ["/" ; common prefix
{"index.html" :index
"article.html" :article}]
routes-2 ["/" ; common prefix
{"" :index ; add a default route so "/" and "/index.html" both => `:index` handler
"index.html" :index
"article.html" :article}]]
(is= (bidi/match-route routes "/index.html") {:handler :index}) ; normal case
(is= (bidi/match-route routes "/") nil) ; plain "/" route is not available, has no default
(is= (bidi/match-route routes-2 "/") {:handler :index})) ; Now we get the :index route
Если маршрут не соответствует, match-route
возвращает nil
, что Затем сервер преобразуется в 500 not-found
, который отправляется в браузер.