|
2 | 2 | (:require [compojure.core :as compo :refer [defroutes GET POST ANY]] |
3 | 3 | [compojure.route :as route] |
4 | 4 | [clojure.java.io :as io] |
| 5 | + [clojure.string :as str] |
5 | 6 | [cheshire.core :as json] |
6 | 7 | [meetcute.logic :as logic] |
7 | 8 | [smallworld.util :as sw-util] |
8 | 9 | [meetcute.auth :as mc.auth] |
9 | 10 | [meetcute.util :as mc.util] |
10 | 11 | [ring.util.mime-type :as mime] |
11 | 12 | [ring.util.request] |
12 | | - [ring.util.response :as resp] |
13 | | - [cheshire.core :refer [generate-string]] |
14 | | - [clojure.string :as str] |
15 | | - [smallworld.airtable :as airtable])) |
| 13 | + [ring.util.response :as resp])) |
16 | 14 |
|
17 | 15 | (defn parse-body-params [body] |
18 | 16 | (json/parse-string body true)) |
|
54 | 52 | (defn tmp-file-path [file] |
55 | 53 | (if (= (:prod sw-util/ENVIRONMENTS) (sw-util/get-env-var "ENVIRONMENT")) |
56 | 54 | (str "https://smallworld.kiwi/tmp/" (:filename file)) |
57 | | - (str "https://7138-186-177-83-218.ngrok-free.app/tmp/" (:filename file)))) |
| 55 | + (do |
| 56 | + (println "<NGROK> you are using ngrok to upload files. Have you changed the ngrok URL? </NGROK>") |
| 57 | + (str " https://b15f-137-103-250-209.ngrok-free.app/tmp/" (:filename file))))) |
58 | 58 |
|
59 | 59 | (defn tmp-upload-handler [request] |
60 | 60 | (try |
|
106 | 106 | (ANY "/api/echo" req (resp/response (pr-str req))) |
107 | 107 | (POST "/api/matchmaking/me" req (let [parsed-jwt (mc.auth/req->parsed-jwt req)] |
108 | 108 | (assert parsed-jwt) |
109 | | - (generate-string {:fields (logic/my-profile parsed-jwt)}))) |
| 109 | + (json/generate-string {:fields (logic/my-profile parsed-jwt)}))) |
110 | 110 | (GET "/api/get-airtable-db-name" _ (json/generate-string (logic/get-airtable-db-name))) |
111 | 111 | (POST "/api/admin/update-airtable-db" req (logic/update-airtable-db req)) |
112 | 112 | (POST "/api/refresh-todays-cutie" req (let [parsed-body (:params req) |
|
0 commit comments