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

Howto use lib-noir stateful-sessions in Compojure

I think I have a fairly straightforward problem here. But I've been looking at this screen too long. So I'm trying (and failing) to get stateful sessions working in Compojure. The refheap code paste is here. You can see me trying to use lib-noir…
Nutritioustim
  • 2,686
  • 4
  • 32
  • 57
6
votes
2 answers

Clojure: Dynamically create functions from a map -- Time for a Macro?

I have a function that begins like this: (defn data-one [suser] (def suser-first-name (select db/firstNames (fields :firstname) (where {:username suser}))) (def suser-middle-name (select…
dizzystar
  • 1,055
  • 12
  • 22
6
votes
2 answers

How to do HTTP 302 redirects with Noir Web framework

I'm helping to set up a Web site with Clojure's Noir framework, though I have a lot more experience with Django/Python. In Django, I'm used to URLs such as http://site/some/url being 302-redirected automagically to http://site/some/url/ Noir…
JohnJ
  • 4,753
  • 2
  • 28
  • 40
6
votes
1 answer

Attempting to Create a User Login for Clojure / Korma / PostgreSQL site

I am completely stuck on where to start with getting a log-in area for a Clojure site I am building (for fun). I've looked at several resources, which I'll post below, mercilessly copy/pasted code, and the closest I can get is one of two…
dizzystar
  • 1,055
  • 12
  • 22
5
votes
3 answers

Clojure Noir Json Put

I'm working through the tutorial Mark McGranaghan REST Tutorial however I'm trying to do it using Noir instead. I can add new items, however it never takes the body of the PUT command. I think the problem with how I'm trying to construct the put…
Dale
  • 579
  • 1
  • 7
  • 13
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

Get the host address programmatically in webnoir

I'm developing a Clojure webnoir app and I need to construct a callback url (for Twitter oauth) that is different in dev-mode than it is in production mode. In dev-mode it needs to be localhost:8080/smth and on production (heroku) obviously…
Michiel Borkent
  • 34,228
  • 15
  • 86
  • 149
5
votes
2 answers

How to build the war file for a Clojure Noir Web application?

I was able to use these commands to generate and run a sample web app from instrcution on this web site https://github.com/ibdknox/lein-noir lein new noir my-project-name lein run ( I am using Leiningen 2.0.0-preview10 on Java 1.7.0_09 Java…
user193116
  • 3,498
  • 6
  • 39
  • 58
5
votes
1 answer

Modelling/Programming European roulette board in Clojure

For school we are creating a roulette webapplication in Clojure with the webnoir framework. Everything seems realizable in Clojure, but the problem is: how do we define the board in our domain in Clojure? It must be possible to place corner bets…
mrtentje
  • 1,402
  • 2
  • 22
  • 43
5
votes
1 answer

Webnoir website as Eclipse project, resources can't be found

I have this webnoir webapp as an Eclipse project. You can download it here: http://dl.dropbox.com/u/3914693/practicum5.zip When I start it up, using the -main function from Eclipse, the resources folder doesn't seem to be found (I get a 404 on…
Michiel Borkent
  • 34,228
  • 15
  • 86
  • 149
4
votes
3 answers

Clojure warning: "resultset-seq already exists in clojure.core"

I'm new to Clojure and building a web app using the Noir framework (very similar to Compojure, in fact I think it's Compojure with a different request handler layer). I'm getting a warning when I import the JDBC library: WARNING: resultset-seq…
Adam
  • 3,063
  • 5
  • 35
  • 49
4
votes
3 answers

Clojure use of (for) with hiccup and noir

I am using clojure and hiccup (with noir) and I have this code: (defn dataframe [id] (db/db-to-data id)) (defpartial drop-downs [nms] (for [nm (keys nms)] (drop-down nm (get nms nm))[:br]) (submit-button "Refresh") ) (defpage…
kfk
  • 831
  • 2
  • 12
  • 25
4
votes
2 answers

How to test session state with Ring?

I'm trying out Clojure web development with Ring + Compojure + lib-noir, and I can't figure out how to test the session state.
john2x
  • 22,546
  • 16
  • 57
  • 95
4
votes
2 answers

Noir uberjar only works in build directory

I am attempting to distribute a small web application build with the clojure web framework noir. It works as expected when run with lein run. When I run lein uberjar and then java -jar project-1.0.0-standalone.jar it works as expected. However, if I…
4
votes
1 answer

passing data to noir views - Clojure

I'm working with Noir and I can't figure out how to pass information to the views. Right now I have a ref in proj.core/my-ref which is updated in a worker thread. I need to access the ref's value from a view created via defpage located at…
Ilia Choly
  • 18,070
  • 14
  • 92
  • 160