From 258315b0d78e8e498a21b552e8ddbeda559eabc2 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:26:50 -0600 Subject: [PATCH] Provisionally use global URIs for some endpoints In the simple-server, use `/inbox` instead of `/user/inbox`, etc. --- docs/examples/simple-server.lisp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/examples/simple-server.lisp b/docs/examples/simple-server.lisp index 65433c4..755a66c 100644 --- a/docs/examples/simple-server.lisp +++ b/docs/examples/simple-server.lisp @@ -150,13 +150,15 @@ The ID and ENDPOINTS are derived using the parameter USERNAME and the global *US (let ((obj (make-instance 'user)) (uri (format nil *user-id-format* (getf *config* :host) username))) - (flet ((sub-uri (path) - (format nil "~A/~A" uri path))) + (flet ((sub-user-uri (path) + (format nil "~A/~A" uri path)) + (sub-host-uri (path) + (format nil "~A/~A" (getf *config* :host) path))) (setf (ass:preferred-username obj) username) (setf (ass:name obj) nickname) - (setf (ass:inbox obj) (sub-uri "inbox")) - (setf (ass:outbox obj) (sub-uri "outbox")) - (setf (ass:following obj) (sub-uri "following")) - (setf (ass:followers obj) (sub-uri "followers")) + (setf (ass:inbox obj) (sub-host-uri "inbox")) + (setf (ass:outbox obj) (sub-host-uri "outbox")) + (setf (ass:following obj) (sub-user-uri "following")) + (setf (ass:followers obj) (sub-user-uri "followers")) (setf (json-ld:@id obj) uri)) obj))