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
0
votes
1 answer

How do I make a page visible with or without ending slash in the url?

I use noir. Having : (defpage "/welcome" [] "Welcome to Noir!") I do I make both these URL works: http://localhost:8080/welcome http://localhost:8080/welcome/ Thanks! EDIT: Here's the complete answer. In server.clj, add up (:use…
leontalbot
  • 2,513
  • 1
  • 23
  • 32
0
votes
0 answers

Auto restarting a ring application after a crash

I've got a simple Clojure web application based on ring, compojure and enlive. I run it on a linux VPS with the following command: nohup lein trampoline run -m .routes & From time to time it crashes and I haven't quite diagnosed…
Daniel Neal
  • 4,165
  • 2
  • 20
  • 34
0
votes
1 answer

Line-seq ignore \n in string

I have a problem with liberator body-as-string function and line-seq. (println (line-seq (BufferedReader. (StringReader. (body-as-string ctx))) ) ) With this curl command the function return (h1,h2\nh3,h4\nh5,h6) instead of (h1,h2…
jeremieca
  • 1,156
  • 2
  • 13
  • 38
0
votes
1 answer

Using LevelDB in a ring/compojure webapp

I am am trying to setup LevelDB in a ring/compojure app, and looking for an idiomatic way to to access the opened db descriptor into each request. For example: (defn -main "I don't do a whole lot ... yet." [& args] (println "Opening LevelDB…
0
votes
1 answer

Compojure Ring Server Generated By 'lein ring server' Acting Oddly

So I was coding and I got an exception. I fixed the exception and then went back to check that things were working. Instead of seeing my fixes I instead saw the website that was generated prior to the exception having been thrown. Like my previous…
Joshua
  • 547
  • 1
  • 5
  • 13
0
votes
4 answers

Is there a clojure Ring adapter for Vertx?

I am using clojure with Vertx and can see my request/response roundtrip. However I would like to leverage the Ring framework, which comes with only a Jetty adapter. Does anyone know of a ready made one for Vertx? I am interested in learning how to…
KingCode
  • 858
  • 1
  • 9
  • 9
0
votes
2 answers

How do I write this macro in clojure?

I've got this function: (defn handler [request] (case (request :uri) "/" (home request) "/good" (good request) "/evil" (evil request) "/neutral" (neutral request) (status-response 404 (str "

404 Not Found: " (:uri request)…

John Lawrence Aspden
  • 17,124
  • 11
  • 67
  • 110
0
votes
1 answer

reload middleware that handles explicitly loaded source files

Ring comes with the middleware 'reload' (https://github.com/ring-clojure/ring/blob/master/ring-devel/src/ring/middleware/reload.clj). It's based on ns-tracker (https://github.com/weavejester/ns-tracker). ns-tracker looks through source directories…
hutch
  • 326
  • 1
  • 8
0
votes
1 answer

how to define common routes or subsequent routes in moustache / ring

I have two moustache routes basically the http://localhost and http:localhost/ route which point to the same function - [""] (-> (index) response constantly) ["/"] (-> (index) response constantly) How do I - Is it possible to specify both of…
murtaza52
  • 46,887
  • 28
  • 84
  • 120
0
votes
1 answer

Terminating Jetty server thread pool if exception on start()

I'm writing an embedded Jetty app in Clojure, and have the following as the main namespace: (ns rudkus.core (:require [clojure.tools.cli :as cli] [ring.adapter.jetty :as jetty]) (:gen-class)) (defn handler [request] {:status 200 …
jennykwan
  • 2,631
  • 1
  • 22
  • 33
-1
votes
1 answer

Ring + api binance + curl

i try to translate in Ring language this string of curl (it work, i tested) curl -H "X-MBX-APIKEY: ----MY API KEY HERE----" -X POST 'https://api.binance.com/api/v3/order' -d…
-1
votes
1 answer

Python Ring cache library: ignore None value

How should I tell ring.dict to ignore None value, in other words don't cache if the result of the function is None.
andnik
  • 2,405
  • 2
  • 22
  • 33
-1
votes
1 answer

Missing GLIBC executing the ring interpreter after recent update

When executing the ring interpreter after a recent update to 1.13 on Ubuntu 18.04.5 LTS I get the following error: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/lib/libring.so) I've tried a re-install with no…
-1
votes
2 answers

C Basic ring buffer issue

I'm having an issue with a basic ring buffer that I am trying to make. I can not seem to get it to wrap around correctly. When I hit the number of elements = buffer_length, the behavior becomes unpredictable and in the debugger it will only show the…
Jim
  • 3
  • 1
1 2 3
31
32