parent
bc87e5de01
commit
3c83e74a84
2 changed files with 3 additions and 4 deletions
|
@ -7,6 +7,8 @@
|
||||||
#:regex-replace
|
#:regex-replace
|
||||||
#:regex-replace-all)
|
#:regex-replace-all)
|
||||||
(:import-from #:ningle)
|
(:import-from #:ningle)
|
||||||
|
(:import-from #:lack/response
|
||||||
|
#:response-status)
|
||||||
(:import-from #:trivial-system-loader
|
(:import-from #:trivial-system-loader
|
||||||
#:load-system)
|
#:load-system)
|
||||||
(:export #:pathname->path
|
(:export #:pathname->path
|
||||||
|
@ -60,6 +62,7 @@
|
||||||
(if (string= uri "/not-found")
|
(if (string= uri "/not-found")
|
||||||
(let ((handler (find-symbol "HANDLE-NOT-FOUND" pkg)))
|
(let ((handler (find-symbol "HANDLE-NOT-FOUND" pkg)))
|
||||||
(defmethod ningle:not-found ((app ningle:app))
|
(defmethod ningle:not-found ((app ningle:app))
|
||||||
|
(setf (response-status ningle:*response*) 404)
|
||||||
(funcall handler))))
|
(funcall handler))))
|
||||||
(loop
|
(loop
|
||||||
:for method :in *http-request-methods*
|
:for method :in *http-request-methods*
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
(defpackage #:ningle-fbr-test/routes/not-found
|
(defpackage #:ningle-fbr-test/routes/not-found
|
||||||
(:use #:cl)
|
(:use #:cl)
|
||||||
(:import-from #:lack/response)
|
|
||||||
(:import-from #:ningle)
|
|
||||||
(:export #:handle-not-found))
|
(:export #:handle-not-found))
|
||||||
(in-package #:ningle-fbr-test/routes/not-found)
|
(in-package #:ningle-fbr-test/routes/not-found)
|
||||||
|
|
||||||
(defun handle-not-found ()
|
(defun handle-not-found ()
|
||||||
(setf (lack/response:response-status ningle:*response*)
|
|
||||||
404)
|
|
||||||
"Not Found")
|
"Not Found")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue