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
6
votes
4 answers

Missing *out* in Clojure with Lein and Ring

I am running Lein 2 and cider 0.7.0. I made a sample ring app that uses ring/run-jetty to start. (ns nimbus-admin.handler (:require [compojure.core :refer :all] [compojure.handler :as handler] [clojure.tools.nrepl.server…
Steve
  • 1,596
  • 1
  • 10
  • 21
6
votes
1 answer

how I can start lein ring server in background?

Now what I do is: $ lein ring server & Then what I see is: [1]+ Stopped lein ring server. Then I'm trying to use: $ fg 1 And also see that it's stopped. What do I do wrong and how can I run ring as a background process?
6
votes
3 answers

How to Run Jetty Example with Ring in Clojure

I am following along with this example on creating a simple web service in Clojure using ring and jetty. I have this in my project.clj: (defproject ws-example "0.0.1" :description "REST datastore interface." :dependencies …
David Williams
  • 8,388
  • 23
  • 83
  • 171
6
votes
3 answers

Clojure ring wrap-json-params messing up JSON arrays

I'm currently doing some REST API stuff in clojure, and I am using the ring.middleware.format library with compojure to transform JSON to and from clojure data structures. I am having a huge issue, in that and JSON posted to the ring app will have…
Tom Brunoli
  • 3,436
  • 9
  • 36
  • 54
6
votes
3 answers

Clojure/Ring: How can I integrate my clojure app with a java build process that is out of my control?

I have a unique build situation. I am using lein uberwar to build a war out of my ring application and deploy to beanstalk. This is all working great. Now it comes up as a requirement that we need to push code to an svn repo where they will…
prismofeverything
  • 8,799
  • 8
  • 38
  • 53
6
votes
2 answers

Executing a function on ring/compjure application startup after deploy

Possible Duplicate: How to run an arbitrary startup function in a ring project? I am using the clojure ring middleware, with compojure, to build a simple api. I deploy the app often as a war. This works great, but I am looking at ways to have…
Michael Neale
  • 19,248
  • 19
  • 77
  • 109
5
votes
2 answers

How would I implement functionality similar to Rails' url_for with Clojure and its web frameworks?

I'm developing a web application with Clojure, currently with Ring, Moustache, Sandbar and Hiccup. I have a resource named job, and a route to show a particular step in a multi-step form for a particular job defined like this (other routes omitted…
Gert
  • 3,839
  • 19
  • 22
5
votes
1 answer

How to get HttpServletRequest in a Ring handler?

Is there a way to get the HttpServletRequest object in a Ring handler? I am using Noir to develope a web app. I need to get the HttpServletRequest obj when handling a URI. So I use the (noir.request.ring-request) function to get back the ring…
eureka
  • 463
  • 1
  • 3
  • 9
5
votes
2 answers

is it possible to call java servlet from ring/compojure?

I have to call a servlet written in Java from Clojure web application, and I don't understand how to do that. Developing a webapp in Java, I had to describe all mappings in web.xml. In Compojure, I see, I must describe routes. So, can I bind the…
5
votes
1 answer

When is the ring anti-forgery token inserted?

I'm trying to understand when the ring anti-forgery token is generated or inserted in an HTML page. I'm using Compojure / ring / hiccup but I take it my question is really about ring. I don't have any problem per se: I just want to know when and how…
Cedric Martin
  • 5,945
  • 4
  • 34
  • 66
5
votes
2 answers

How can I communicate with the backend using ClojureScript and Figwheel?

Note: I'm a moderately experienced programmer in general and using clojure but have never done serious web development. I set up a basic ClojureScript project using Chestnut and walked through the "Hello World" steps just fine. However I would…
Sebastian Oberhoff
  • 1,271
  • 1
  • 10
  • 16
5
votes
1 answer

How to do integration testing in Clojure?

What are the techniques and libraries to do the integration testing in Clojure. Specifically interaction with databases, ring applications, core.async channels, anything which produces a side-effect.
Aliaksandr Kazlou
  • 3,221
  • 6
  • 28
  • 34
5
votes
1 answer

Can I make lein ring server-headless run on a specific servlet context?

I have a Ring app that through deploys to production as an uberwar thing; myservice.war. In production the WAR file gets tossed into Jetty where it runs in a context that follows its name $ curl -i -X GET…
Bob Kuhar
  • 10,838
  • 11
  • 62
  • 115
5
votes
2 answers

Clojure JSON: Exception: com.fasterxml.jackson.core.JsonGenerationException: Cannot JSON encode object of class:

I am trying to create a node in my Neo4j datastore using clojure neocons and I am running into an error that I think is related to formatting json: Exception: com.fasterxml.jackson.core.JsonGenerationException: Cannot JSON encode object of class:…
Benjamin McFerren
  • 822
  • 5
  • 21
  • 36
5
votes
2 answers

Clojure: wrap-ssl-redirect on heroku?

I've just tried add this wrapper (-> routes (wrap-ssl-redirect)) for auto redirecting http to https, but when I deploy to heroku, the https:// doesn't get green in my browser, and the website doesn't load. Isn't the default heroku port 443, which…
leontalbot
  • 2,513
  • 1
  • 23
  • 32