website/src/helper.lisp

16 lines
419 B
Common Lisp
Raw Normal View History

(uiop:define-package #:website/helper
(:use #:cl)
(:use-reexport #:hsx
#:jingle
2025-05-17 17:14:58 +09:00
#:jonathan
#:access)
2025-05-17 16:37:45 +09:00
(: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*)))