Questions tagged [yada]

A powerful Clojure web library, full HTTP, full async

yada is a web library for Clojure. It is a sibling library to bidi - whereas bidi is based on routes as data, yada is based on resources as data.

yada takes data declarations and produces a sophisticated Ring handler.

It has the following features :

  • Comprehensive HTTP coverage
  • Parameter coercion, automatic Swagger support
  • Async foundation based on manifold
  • Protocol extensibility
5 questions
1
vote
1 answer

How to use optional query parameters in Yada?

I'm making a toy API using the Yada library in Clojure. It searches a database for city names starting with the given characters and returns some info about it. I want a URI of the form: /cities/:name?count=:count so for example /cities/ber?count=4…
1
vote
2 answers

How to serve static resources in Yada

With Compojure I can serve static resources like so: (defroutes routes (route/resources "/")) Following the Yada docs I have this working: (def server (listener ["/" [["hello" (as-resource "Hello World!")] ["test" (resource…
Jacob O'Bryant
  • 311
  • 2
  • 10
1
vote
1 answer

Prepend function to every route request in yada

currently i am playing with Yada as web lib. Now i want to execute some function before a route is hit. Approaches I have tested: - wrap the current resource as sub-resource, but then the swagger-doc doesn't find the resource - using an…
Tobias S
  • 1,275
  • 8
  • 23
1
vote
1 answer

Clojure - use a core.async channel with Yada/Aleph

I am trying to use Clojure manifold library, and in order to understand it, I need wanted to convert a core.async channel into a manifold stream. I would like to create the equivalent the following using a core.async channel : (require…
nha
  • 17,623
  • 13
  • 87
  • 133
0
votes
2 answers

How to configure yada to allow cross-origin requests (Clojure)?

I have a yada resource configured as below: (yada/resource {:methods {:get {:produces "text/plain" :response (fn [ctx] "Hello world!!")}}}) and a curl -i localhost:8080/api/new…
KByrne
  • 1
  • 1
  • 1