From 540038b4ddb7a25beaa1196001544915cfefe007 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Sat, 9 Jul 2022 08:32:33 -0700 Subject: [PATCH] startup for getting ezcater going. --- src/clj/auto_ap/handler.clj | 3 ++- src/clj/auto_ap/routes/ezcater.clj | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/clj/auto_ap/routes/ezcater.clj diff --git a/src/clj/auto_ap/handler.clj b/src/clj/auto_ap/handler.clj index 649bbba8..344e5b2e 100644 --- a/src/clj/auto_ap/handler.clj +++ b/src/clj/auto_ap/handler.clj @@ -7,7 +7,7 @@ [auto-ap.routes.graphql :as graphql] [auto-ap.routes.invoices :as invoices] [auto-ap.routes.queries :as queries] - [auto-ap.routes.yodlee :as yodlee] + [auto-ap.routes.ezcater :as ezcater] [auto-ap.routes.yodlee2 :as yodlee2] [bidi.bidi :as bidi] [buddy.auth.backends.token :refer [jws-backend]] @@ -59,6 +59,7 @@ queries/query2-routes invoices/routes graphql/routes + ezcater/routes auth/routes health-check)) diff --git a/src/clj/auto_ap/routes/ezcater.clj b/src/clj/auto_ap/routes/ezcater.clj new file mode 100644 index 00000000..462dec35 --- /dev/null +++ b/src/clj/auto_ap/routes/ezcater.clj @@ -0,0 +1,21 @@ +(ns auto-ap.routes.ezcater + (:require + [clojure.tools.logging :as log] + [compojure.core :refer [context defroutes GET POST]] + [ring.middleware.json :refer [wrap-json-params]] + [ring.util.request :refer [body-string]])) + +(defroutes routes + (wrap-routes + (context "/ezcater" [] + (GET "/event" request + (log/info (str "GET EVENT " (body-string request) request)) + {:status 200 + :headers {"Content-Type" "application/json"} + :body "{}"}) + (POST "/event" request + (log/info (str "POST EVENT " (body-string request) request)) + {:status 200 + :headers {"Content-Type" "application/json"} + :body "{}"})) + wrap-json-params))