Posts

Showing posts with the label Ajax

How to do an upload using REST (Swagger) and Clojurescript (ajav

Hoping to help someone else that is also struggling with this. I have used Luminus with Reagent to try this. Luminus come with Swagger for REST API, it's a great tool because it gives you the possibility to try the API as soon as you have write it. This is the code to write a REST end-point that accept a file in upload (ns your-clojure-ns   (:require [ring.util.http-response :refer :all]             [compojure.api.sweet :refer :all]             [schema.core :as s]             [ring.swagger.upload :as upload]) (defapi service-routes   {:swagger {:ui "/swagger-ui"              :spec "/swagger.json"              :data {:info {:version "1.0.0"                            :title "Sample API"                 ...