|
|
@ -307,9 +307,15 @@
|
|
|
|
;; 404 route
|
|
|
|
;; 404 route
|
|
|
|
(define/contract (route-404 req)
|
|
|
|
(define/contract (route-404 req)
|
|
|
|
(request? . -> . response?)
|
|
|
|
(request? . -> . response?)
|
|
|
|
|
|
|
|
(define missing-url (url->string (request-uri req)))
|
|
|
|
(define missing-path-string (path->string (simplify-path (req->path req))))
|
|
|
|
(define missing-path-string (path->string (simplify-path (req->path req))))
|
|
|
|
(message (format "can't find ~a" missing-path-string))
|
|
|
|
(message (format "can't find ~a" missing-url))
|
|
|
|
(response/xexpr+doctype
|
|
|
|
(response/xexpr+doctype
|
|
|
|
`(html
|
|
|
|
`(html
|
|
|
|
(head (title "404 error") (link ((href "/error.css") (rel "stylesheet"))))
|
|
|
|
(head (title "404 error") (link ((href "/error.css") (rel "stylesheet"))))
|
|
|
|
(body (div ((class "section")) (div ((class "title")) "404 error") (p ,(format "~v" missing-path-string) " was not found"))))))
|
|
|
|
(body (div ((class "section"))
|
|
|
|
|
|
|
|
(div ((class "title")) "404 error")
|
|
|
|
|
|
|
|
(p ,(format "URL ~v was not found at path ~v" missing-url
|
|
|
|
|
|
|
|
(match missing-path-string
|
|
|
|
|
|
|
|
[(regexp #rx"/$") (string-append missing-path-string "index.html")]
|
|
|
|
|
|
|
|
[mps mps]))))))))
|
|
|
|