Questions tagged [noir]

Noir is a micro-framework that allows you to rapidly develop websites in Clojure.

Noir uses the Compojure library for URL routing, Ring for low level HTTP, and Hiccup for HTML generation. It is a web application framework that builds on top of these things to provide an environment for building web applications.

85 questions
4
votes
3 answers

Acessing resource files in clojure webnoir project

I am working on a small Clojure project using Leiningen with the following directory structure: project src test xxx login.clj resources public css bootstrap.css In the login.clj file in the test directory, I'm trying to…
r0hitsharma
  • 1,592
  • 12
  • 16
4
votes
2 answers

'jQuery' type function for manipulating clojure maps

Is there a jQuery type function to solve the problem of walking through nested maps? for example, if i have a configuration that looks like this: (def fig {:config {:example {:a "a" :b "b" :c "c"} :more …
zcaudate
  • 13,998
  • 7
  • 64
  • 124
4
votes
1 answer

Noir and Lein under Eclipse

I am trying to use CCW + lein for clojure devl. I built a small Noir app which has page for / with command line lein run , I am able to see the output at localhost But how to run within CCW + Lein under eclipse , I press Run , and then open the…
Sunil
  • 127
  • 4
  • 11
4
votes
3 answers

How to get JSON post data in Noir

A while back, Chris Granger posted this middleware to get JSON hashes to appear in the defpage params under an umbrella "backbone" element. (defn backbone [handler] (fn [req] (let [neue (if (= "application/json" (get-in req [:headers…
Dax Fohl
  • 10,654
  • 6
  • 46
  • 90
4
votes
0 answers

How do I use a web.xml file with noir?

I'm writing a web app in clojure, and want to edit Jetty's settings. One way to do this is to use a web.xml file. How do I use a web.xml file with Jetty?
Paul Biggar
  • 27,579
  • 21
  • 99
  • 152
3
votes
1 answer

Best practice running a Clojure background process on windows

I've got a process that will constantly run in the background, update a database, then the results can be checked in a noir based web app. I'm currently running on windows. The currently runs as a local java process, however I'm wondering what the…
Dale
  • 579
  • 1
  • 7
  • 13
3
votes
1 answer

In Clojure, is there an idiomatic way of destructuring a map in a macro definition?

I've been using noir in a web project and I came up to the point of restricting access to users, depending on their access level (and sublevel) to all possible routes defined by a defpage macro. So originally I had (defpage [:post "/mysite"] {:as…
3
votes
1 answer

Generate img tags with Noir from a list

I have a list of photo links and would like to generate img tags with clojure and noir. Here I get the links: (def photos (->> (get-in result ["photoset" "photo"]) (map #(str "http://farm"(get % "farm") ".staticflickr.com/"(get % "server")"/"(get %…
Nico
  • 1,071
  • 1
  • 23
  • 39
3
votes
1 answer

Add webapp frontend to existing clojure app

I have a Clojure-based chat bot that I start up in typical leiningen fashion with lein run. I'd like to add a front end to this app, but not totally sure how to go about it. From reading docs on compojure, lib-noir and ring, looks like the standard…
devth
  • 2,738
  • 4
  • 31
  • 51
3
votes
1 answer

Basic HTTP Authentication with Noir

I've been starting to figure out how to use noir and I would now like to use http basic authentication. I've stumbled upon https://github.com/adeel/ring-http-basic-auth . Though, the given examples seem to apply to compojure and not to noir. I…
Pedro Rolo
  • 28,273
  • 12
  • 60
  • 94
3
votes
1 answer

How to restrict screen access in web application..?

i have developed an application and till now i have been successful in restricting screen access by not showing/hiding menu options or buttons for certain screen. But the problem now is user is able to access screen when he types url in address…
ngesh
  • 13,398
  • 4
  • 44
  • 60
3
votes
2 answers

Conditionals in Hiccup, can I make this more idiomatic?

Clojure beginner here! I added flash message support to my Hiccup code in a Noir project. What I'm trying to do is check if the message string for each specific was set or not. If there's no message, then I don't want to display the specific flash …
Alexandr Kurilin
  • 7,685
  • 6
  • 48
  • 76
3
votes
1 answer

Calling noir pages from within the REPL

Is it possible to call (or is request the word?) a page defined with "defpage" complete with POST variables in the REPL? I've created a page with (defpage [:post "/form"] [req] (common/layout ...)) And I would like to see the output of the layout…
redcartel
  • 292
  • 1
  • 3
  • 15
3
votes
1 answer

what is noir.server/start option :ns for?

What is the :ns key for the option map supplied to noir.server/start used for? I see that if you leave out :ns a randomly generated symbol is used. From looking through the Noir source I could not find anywhere where this symbol is used. Does anyone…
Roth Michaels
  • 348
  • 1
  • 6
2
votes
1 answer

real time audio stream using jack on ubuntu server

What would be the best way to live stream audio from an application running through jack on an ubuntu server? My site is built with noir and clojure, but I am generally trying find where to start with achieving this. The audio is generated using…
Jon Rose
  • 1,457
  • 1
  • 15
  • 25