Add json api handler
This commit is contained in:
parent
f9dbc124b3
commit
d508d9ec70
5 changed files with 46 additions and 20 deletions
src
12
src/helper.lisp
Normal file
12
src/helper.lisp
Normal file
|
@ -0,0 +1,12 @@
|
|||
(defpackage #:website/helper
|
||||
(:use #:cl
|
||||
#:jingle)
|
||||
(:export #:api-p))
|
||||
(in-package #:website/helper)
|
||||
|
||||
(defun starts-with-p (prefix string)
|
||||
(let ((pos (search prefix string :start1 0 :end1 (length prefix) :start2 0)))
|
||||
(and pos (= pos 0))))
|
||||
|
||||
(defun api-p ()
|
||||
(starts-with-p "/api/" (request-uri *request*)))
|
Loading…
Add table
Add a link
Reference in a new issue