Change prefix from 'on' to 'handle'
This commit is contained in:
parent
438030b0b8
commit
e84b170a03
2 changed files with 9 additions and 9 deletions
16
README.md
16
README.md
|
@ -48,22 +48,22 @@ To use ningle-fbr, you must use [package-inferred-system](https://asdf.common-li
|
||||||
```lisp
|
```lisp
|
||||||
(uiop:define-package #:example/routes/index
|
(uiop:define-package #:example/routes/index
|
||||||
(:use #:cl)
|
(:use #:cl)
|
||||||
(:export #:on-get
|
(:export #:handle-get
|
||||||
#:on-post
|
#:handle-post
|
||||||
#:on-put
|
#:handle-put
|
||||||
#:on-delete))
|
#:handle-delete))
|
||||||
(in-package #:example/routes/index)
|
(in-package #:example/routes/index)
|
||||||
|
|
||||||
(defun on-get (params)
|
(defun handle-get (params)
|
||||||
...)
|
...)
|
||||||
|
|
||||||
(defun on-post (params)
|
(defun handle-post (params)
|
||||||
...)
|
...)
|
||||||
|
|
||||||
(defun on-put (params)
|
(defun handle-put (params)
|
||||||
...)
|
...)
|
||||||
|
|
||||||
(defun on-delete (params)
|
(defun handle-delete (params)
|
||||||
...)
|
...)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
:do (ql:quickload pkg)
|
:do (ql:quickload pkg)
|
||||||
(loop
|
(loop
|
||||||
:for method :in *http-request-methods*
|
:for method :in *http-request-methods*
|
||||||
:do (let ((handler (find-symbol (concatenate 'string "ON-" (string method))
|
:do (let ((handler (find-symbol (concatenate 'string "HANDLE-" (string method))
|
||||||
pkg)))
|
pkg)))
|
||||||
(when handler
|
(when handler
|
||||||
(setf (ng:route app url :method method) handler))))))
|
(setf (ng:route app url :method method) handler))))))
|
||||||
|
|
Loading…
Reference in a new issue