diff options
Diffstat (limited to 'dynamic/api.scm')
| -rw-r--r-- | dynamic/api.scm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/dynamic/api.scm b/dynamic/api.scm index b899dc6..22a9856 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 rsvp) +(use-modules (dynamic capabilities gallery) + (dynamic capabilities rsvp) (dynamic logging) (srfi srfi-1) (ice-9 match) @@ -32,12 +33,15 @@ (define (handle-api-request request body endpoint) "Route handler for the API server." (let ((method (request-method request)) - (originating-ip (assoc-ref (request-headers request) 'X-Forwarded-For))) - (log-append! 'info (format #f "~a ~a (~a)" method endpoint originating-ip))) + (originating-ip (assoc-ref (request-headers request) 'X-Forwarded-For)) + (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) + ('(GET "gallery") get-gallery) + ('(GET "gallery" "image") get-image) ('(GET "rsvp" "event-info") get-event-info) ('(POST "rsvp") post-event-rsvp) (_ (lambda (. args) (not-found request)))) |