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

Reason for skipping AOT?

In many noir apps I have seen the below declaration. What is the purpose of skipping aot ? When to use it and when not to use it ? Any advantages / disadvantages ? :main ^{:skip-aot true} sample-app.server
murtaza52
  • 45,047
  • 27
  • 78
  • 118
18
votes
4 answers

noir vs compojure?

I'm having trouble understanding the point of clojure's Noir library. It seems to be a framework written on top of compojure that renames defroute to defpage and calls it a day. Obviously an unfair simplification, but what exactly does Noir bring to…
Kevin
  • 23,123
  • 15
  • 92
  • 146
12
votes
3 answers

How to get the current hostname in Heroku

I'm playing around with deploying Clojure/Noir apps on Heroku and I've got my app mostly working. However, one final piece I need is to figure out the hostname of my app when deployed on Heroku. Ideally, I want to do this dynamically instead of…
Rishabh Manocha
  • 2,837
  • 3
  • 16
  • 15
11
votes
2 answers

Compojure or Noir for a UI-less webservice?

If one is planning to create a UI-less web service (receives JSON and/or XML, returns JSON and/or XML), does Noir provide anything useful over and above Compojure?
Paul Butcher
  • 10,222
  • 3
  • 36
  • 42
11
votes
1 answer

No main namepsace error while running a web app in Clojure using Noir

I'm using Noir. This is my project.clj (defproject noir "1.0.0-SNAPSHOT" :description "FIXME: write description" :dependencies [[org.clojure/clojure "1.3.0"]]) lein run gives me this error: No :main namespace specified in project.clj. Where…
Hick
  • 31,852
  • 44
  • 140
  • 235
11
votes
1 answer

Is there a clean way to add functions to a dynamically created namespace?

I am creating a noir webapp, and I need to dynamically create new views and models. I've been following the noir examples, in which the view and the controller for a resource have separate namespaces, and I've found it to be a very clean…
jtmoulia
  • 650
  • 8
  • 19
9
votes
1 answer

how to return a clojure function as a string

is there any way to return a clojure function as a string? I am making some online documentation and I would really like to be able to add code into the html by somehow evaluating a function into text. thanks
Jon Rose
  • 1,379
  • 1
  • 13
  • 24
9
votes
1 answer

How are clojure namespaces looked up?

To start off I am not a Java programmer, so it would be helpful if your answers are not defined in terms of Java (inasmuch as that makes sense). I have a leiningen project (specifically a web project using noir) using what seems to be a common…
benekastah
  • 5,421
  • 1
  • 31
  • 46
9
votes
3 answers

Confusing Clojure Compile Errors -- Bad line reporting?

I am getting compile errors while running lein run on my Noir project. It was working, and then suddenly it stopped working. My suspicion was that the error is connected with trying to include [org.pegdown/pegdown "1.1.0"] in my dependencies vector…
benekastah
  • 5,421
  • 1
  • 31
  • 46
9
votes
1 answer

Pagination in Clojure

Is there anything equivalent to will_paginate for noir/hiccup? How do people usually paginate with noir/hiccup? Thank you
Pedro Rolo
  • 23,843
  • 11
  • 53
  • 92
8
votes
1 answer

Clojure / Noir: Force HTTPS, redirect if the request was http:// to https://

I'm trying to force SSL on my site. I want to have a ring style middle-ware to redirect the site to the same URL with https if it is only http I wrote the following code but it doesn't really do anything besides check the request scheme and print…
dMix
  • 14,498
  • 17
  • 45
  • 61
8
votes
4 answers

Variable passed to macro gets resolved in wrong namespace?

The Noir macro defpage is giving me a little bit of trouble. I am trying to construct a call similar to this: (defpage [:post "some/url"] [data] ;; some stuff... ) However, instead of using the keyword :post I would like to use a variable, like…
benekastah
  • 5,421
  • 1
  • 31
  • 46
6
votes
2 answers

404s when deploying a noir war to jetty on squeeze

I have a feeling I've missed something obvious here, but I don't know where to start looking. I have a fresh noir app, created thusly: $ lein noir new hiworld I add a new page handler to src/hiworld/server.clj: (ns hiworld.server (:require…
regularfry
  • 3,110
  • 2
  • 19
  • 25
6
votes
2 answers

How do you accept file uploads in noir

I have a file input setup like this [:p "Upload a book"] (form-to [:post "/upload"] (file-upload :book) (submit-button "Upload")) My upload endpoint then looks like this. (defpage [:post "/upload"] {:keys [book]}…
Stephen Olsen
  • 643
  • 1
  • 5
  • 13
6
votes
2 answers

Clojure and noir for a classic web application

How would one go about using Noir with user authentication and an ORM. Would it all have to be accessed via java objects? Are there any rails style "blog" tutorials that go about user auth and database access?
Joseph Le Brech
  • 6,358
  • 11
  • 44
  • 80
1
2 3 4 5 6