website/src/helper.lisp

13 lines
323 B
Common Lisp
Raw Normal View History

2025-05-17 16:37:45 +09:00
(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*)))