diff options
Diffstat (limited to 'dynamic/api.scm')
| -rw-r--r-- | dynamic/api.scm | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/dynamic/api.scm b/dynamic/api.scm index 8bbff1e..451c5c6 100644 --- a/dynamic/api.scm +++ b/dynamic/api.scm @@ -14,7 +14,8 @@ ;;; along with this program. If not, see ;;; <http://www.gnu.org/licenses/>. -(use-modules (dynamic capabilities comments) +(use-modules (dynamic capabilities comment-form) + (dynamic capabilities comments) (dynamic capabilities gallery) (dynamic capabilities rsvp) (dynamic logging) @@ -38,14 +39,15 @@ (args (uri-query (request-uri request)))) (log-append! 'info (format #f "~a ~a (~a) (~a)" method endpoint args originating-ip))) ((match (cons (request-method request) endpoint) - ;; ('(GET "challenge") make-challenge) - ('(GET "comments") get-comments) - ('(POST "comment") put-comment) - ('(POST "react") put-reaction) - ('(GET "gallery") get-gallery) - ('(GET "gallery" "image") get-image) - ('(GET "rsvp" "event-info") get-event-info) - ('(POST "rsvp") post-event-rsvp) + ('(GET "dynamic" "comment-form") get-comment-form) + ('(GET "challenge") make-challenge) + ('(GET "api" "comments") get-comments) + ('(POST "api" "comment") put-comment) + ('(POST "api" "react") put-reaction) + ('(GET "api" "gallery") get-gallery) + ('(GET "api" "gallery" "image") get-image) + ('(GET "api" "rsvp" "event-info") get-event-info) + ('(POST "api" "rsvp") post-event-rsvp) (_ (lambda (. args) (not-found request)))) request body)) @@ -68,8 +70,10 @@ (let* ((path-encoded (uri-path (request-uri request))) (path (split-and-decode-uri-path path-encoded))) (define-values (response resp-body) - (if (string= "api" (first path)) - (handle-api-request request body (drop path 1)) + (if (or (string= "api" (first path)) + (string= "dynamic" (first path))) + ;; (handle-api-request request body (drop path 1)) + (handle-api-request request body path) (not-found request))) (values (wrap-response response) resp-body))) |