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
2
votes
2 answers

Parsing a clojure map of items -> categories-vectors into categorized lists

I have map of item names and vectors of vectors which store categories which the key string item are in. I am trying to parse this map into a couple hiccup defpartials which then can display them organized by category. What I think I need to do is…
Jon Rose
  • 1,379
  • 1
  • 13
  • 24
2
votes
1 answer

Can't extract multipart-params from POST request in compojure

When I try to extract the multipart-params from a POST request like this: (defroutes upload-routes (POST "/upload" {params :params} (println params)) I got {}. Then I tried like this: (defroutes upload-routes (POST "/upload" {multipart-params…
Arturo
  • 21
  • 2
2
votes
3 answers

Repeatedly get random element in clojure

I'm messing around in Clojure specifically the Noir web framework and trying to generate a random grid of tiles. This is probably pretty bad code but I'm learning! :D (def tiles [:stairs :stone :monster]) (defpage "/" [] (common/layout …
Kristjan Oddsson
  • 333
  • 3
  • 17
2
votes
2 answers

Converting compojure noir to Liberator

I'm fairly new to clojure/compojure, but really love it. Naturally, started my exploration with Noir stack. Have written a POC app. Then, discovered Liberator -- makes a whole lot of sense. Just wondering, if anybody has ever migrated Noir…
dmitryame
  • 478
  • 4
  • 17
2
votes
1 answer

How to deploy clojure noir website on a 3d party web hosting server?

I have built my own website using clojure (noir), but I have no clue on how to deploy the website to a web hosting server. I know how to run it on a virtual port (localhost8080). Is there some sort of way to compile all clojure code into javascript…
Danny Watts
  • 559
  • 1
  • 6
  • 17
2
votes
1 answer

Clojure Noir: how to set up basic authentication for only a part of the application

I have set up HTTP Basic authentication for my app using Ring Basic Authentication. It works just fine and looks like this: (:require [noir.server :as server] ... (server/add-middleware wrap-basic-authentication authenticated?) authenticated? is my…
auramo
  • 12,607
  • 12
  • 62
  • 87
2
votes
1 answer

Nest Noir Routes

I have an app that generates keys based for specific datastores. If there are 7 such routes and 5 apps, there would be a total of 35 routes in my event.clj (or, if split out, 7/file in 5 files). I would like to do the following…
Chris
  • 10,888
  • 18
  • 82
  • 142
2
votes
2 answers

Noir render function causes NullPointerException

In my Clojure application I'm using Noir as web framework. I have one post page defined which is saving some data onto a mongodb database and I'm then trying to render another page: (defpage "/delivery/save" [delivery] (let [id (save-delivery…
Nico Balestra
  • 256
  • 3
  • 12
2
votes
1 answer

Heroku + Clojure (webnoir), how to do lein clean?

I'm hosting a webnoir site on heroku and after renaming a namespace and file, I'm getting the following error in the log: Warning: coercions not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please…
OnResolve
  • 3,938
  • 3
  • 25
  • 46
2
votes
1 answer

Noir - unable to resolve symbol html5 in this context

I am trying to use noir and am following the tutorial that is given at the default tutorial and am using this code (defpage "/my-page" [] (html5 [:h1 "This is my first page!"])) However, clojure throws up an error and refuses to work.
logiblocs
  • 58
  • 5
2
votes
2 answers

how add authentication in a middleware or pre-route?

how to carry out an authentication process for each request sent. The problem i'm currently facing is i'm not able access user data which is sent as a request param. here is what i have tried (pre-route[:any "/mainpage/*"] {:keys[data]} (when…
ngesh
  • 13,044
  • 4
  • 41
  • 59
2
votes
2 answers

Clojure namespacing converting - to _

The error as shown on the Noir error page: java.io.FileNotFoundException: Could not locate boundaries/lat_long__init.class or boundaries/lat_long.clj on class path The code that requires it: (ns boundaries.views.boundary (:use noir.core …
Chris
  • 10,888
  • 18
  • 82
  • 142
2
votes
1 answer

load-views when running multiple noir servers

I'm experimenting with using noir to start three servers (each to handle a different aspect of the application). I am trying to do this so that I can run all three servers within one application while developing and easily decouple the project into…
Roth Michaels
  • 348
  • 1
  • 6
2
votes
1 answer

How to create REST API in noir to receive list of ids?

How I can have an API which can be called as http://our.api.com/product/, and receive the list of ids using webnoir ?
kushaldas
  • 58
  • 1
  • 4
2
votes
1 answer

clojure-noir project with generated uberjar - NoClassDefFoundError

Following http://www.webnoir.org/ instructions to create a new project - I ran lein uberwar - this generates a single (executable) jar - however it is not able to find the main class as mentioned in the manifest - no class file found. The app runs…
Michael Neale
  • 18,590
  • 18
  • 72
  • 106