Questions tagged [ring]

Ring is a Clojure web applications library written by Mark McGranaghan. It was inspired by Python's WSGI and Ruby's Rack. By abstracting the details of HTTP into a simple, unified API, Ring allows web applications to be constructed of modular components that can be shared among a variety of applications, web servers, and web frameworks.

Ring is a Clojure web applications library written by Mark McGranaghan. It was inspired by Python's WSGI and Ruby's Rack. By abstracting the details of HTTP into a simple, unified API also known as the Ring spec, Ring allows web applications to be constructed of modular components that can be shared among a variety of applications, web servers, and web frameworks.

Mark gave a presentation which provided an overview of Ring at Clojure conj called "One Ring to Bind Them".

479 questions
5
votes
0 answers

Compojure handler friend/authenticate eats body of POST request

How can I safely get the content of the :body InputStream from compojure? See related but different question for background. I'm trying to authenticate my ring routes with Friend using compojure handler/site but when I try to read the :body from an…
sventechie
  • 1,859
  • 1
  • 22
  • 51
5
votes
1 answer

lein ring server with nrepl doesn't honour cider-nrepl

When I start up my current project with lein ring server and try to connect to it from Emacs via cider, I get the following warning: ; CIDER 0.8.2 (Java 1.7.0_51, Clojure 1.6.0, nREPL 0.2.6) WARNING: The following required nREPL ops are not…
schaueho
  • 3,419
  • 1
  • 21
  • 32
5
votes
1 answer

Handle subdomains for a Clojure classified web app hosted on Heroku

I have a classified clojure web app I want to host on Heroku. The domain is registered at Godaddy. What would be the most effective and efficient way to have multiple subdomains: newyork.classapp.com montreal.classapp.com paris.classapp.com…
leontalbot
  • 2,513
  • 1
  • 23
  • 32
5
votes
1 answer

No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil

I'm very new to Clojure and I'm having a great time playing with it. One thing I'm having some trouble with is how to read the errors, I personally think they're not very descriptive, but that's probably due to my "newbieness". For example, the…
Gustavo Matias
  • 3,508
  • 3
  • 27
  • 30
5
votes
2 answers

How do you enable https and http->https redirects in ring / compojure

I am developing a RESTful app, for which I need to redirect requests coming in from an http address to it's https equivalent. I cannot seem to be able to enable https using ring/compojure. Anyone have some useful tutorials and/or links? I haven't…
dsm
  • 10,263
  • 1
  • 38
  • 72
5
votes
1 answer

How can I add a build step to leiningen?

So I've got an application built using Foundation and Ring, and I want to be able to compile my custom Foundation CSS whenever I run lein ring server or the like. Specifically, I'd like to be able to add a step the runs compass compile [path].…
alexgolec
  • 26,898
  • 33
  • 107
  • 159
5
votes
1 answer

How to redirect users to a different page if they aren't logged in? (ring/compojure)

what's the best way to route to one page if the user is signed in (i.e. session has a non-nil value for the user-id key) and another if the user is not signed in? The ideal would be 2 different set of routes. Thanks! Also, are there any good example…
hurshagrawal
  • 663
  • 6
  • 15
5
votes
2 answers

Automatic Code reloading in Ring / Jetty

Using Ring / Jetty with Clojure, when I make any changes to my code, I have to reload my entire JVM. Is there anyway of keeping Jetty asynchronous with changes in my code, so I can simply refresh the browser window and get changes…
Robin Johnson
  • 309
  • 2
  • 10
5
votes
1 answer

servlet integrated security in clojure / ring?

I have been searching a nice way to leverage integrated security on existing servlets containers in ring web applications. It looks like people is trying to reinvent the wheel out there with their own ring middleware to handle…
jorgeu
  • 689
  • 6
  • 14
5
votes
1 answer

How to maintain state across different user sessions in a ring app

I have a need to maintain global state on the server across different browser / user sessions. My assumption here is that all atoms etc created when a request comes in is specific to that request. Once the response is returned all that state is…
murtaza52
  • 46,887
  • 28
  • 84
  • 120
5
votes
1 answer

Using Compojure, Hiccup and Ring to upload MULTIPLE files

This is really a rip off of Using Compojure, Hiccup and Ring to upload a file If there is a multiple tag:
zcaudate
  • 13,998
  • 7
  • 64
  • 124
5
votes
2 answers

Clojure: Webbit + Ring

Context I just got http://blog.jayfields.com/2011/02/clojure-web-socket-introduction.html working. I also have ring + compojure working. Question: I would like to use ring ... somehow ... with webbit is this possible? Thanks!
user1383359
  • 2,673
  • 2
  • 25
  • 32
4
votes
2 answers

clojure redis set is setting the length of the string of the value instead of the value

I am using the following code to set keys in redis (defn save-to-redis[key value] (let [str-value (json/generate-string value)] (redis/with-server {:host "127.0.0.1" :port 6379 :db 0} (redis/set key str-value)))) but when I check…
Benjie Holson
  • 175
  • 1
  • 6
4
votes
1 answer

Put Clojure Ring middlewares in correct order

I'm having trouble with my Clojure server middlewares. My app has the following requirements: Some routes should be accessible with no problems. Others require basic authentication, so I'd like to have an authentication function that sits in front…
Kevin Burke
  • 61,194
  • 76
  • 188
  • 305
4
votes
1 answer

How do you serve dynamically created files in clojure ring server?

I have a web server that saves files uploaded by the user to the native filesystem in the resources folder. It works fine in development but in production, the files can't be served. I've tried wrap-file and wrap-resource, neither works.
danieltan95
  • 810
  • 7
  • 14