Questions tagged [compojure]

Compojure is an open source web framework for the Clojure programming language.

Compojure

Author: James Reeves
Categories: web
License: EPL
Source code: https://github.com/weavejester/compojure

Dependencies: clojure.contrib, a Java servlet container (e.g. Jetty)

Compojure is a web framework that emphasizes a thin I/O layer and a functional approach to web development. It includes an integrated Jetty web server, but can be used with any Java servlet container.

FAQ

Useful links

442 questions
113
votes
5 answers

What's the "big idea" behind compojure routes?

I'm new to Clojure and have been using Compojure to write a basic web application. I'm hitting a wall with Compojure's defroutes syntax, though, and I think I need to understand both the "how" and the "why" behind it all. It seems like a Ring-style…
Sean Woods
  • 2,514
  • 3
  • 18
  • 24
56
votes
7 answers

How To Integrate Clojure Web Applications in Apache

Note Given this OP was written about two years ago, rather than ask the same question again, I am wondering if step-by-step instructions exist, so that I can integrate a Noir or other Clojure web application into Apache, whether it's Jetty, Tomcat,…
futlib
  • 8,258
  • 13
  • 40
  • 55
42
votes
6 answers

Compojure routes with different middleware

I'm currently writing an API in Clojure using Compojure (and Ring and associated middleware). I'm trying to apply different authentication code depending on the route. Consider the following code: (defroutes public-routes (GET "/public-endpoint"…
user1391110
37
votes
8 answers

Compojure development without web server restarts

I've written a small Swing App before in Clojure and now I'd like to create an Ajax-style Web-App. Compojure looks like the best choice right now, so that's what I'm going to try out. I'd like to have a real tiny edit/try feedback-loop, so I'd…
auramo
  • 13,167
  • 13
  • 66
  • 88
34
votes
8 answers

Serve index.html at / by default in Compojure

I have a static file called index.html that I'd like to serve when someone requests /. Usually web servers do this by default, but Compojure doesn't. How can I make Compojure serve index.html when someone requests /? Here's the code I'm using for…
Kevin Burke
  • 61,194
  • 76
  • 188
  • 305
27
votes
3 answers

Unable to complete POST request in Clojure

I have recently started exploring Clojure and I wanted to set up a simple web app with basic CRUD functionality. I found a nice tutorial here: http://www.xuan-wu.com/2013-09-21-Basic-Web-Application-in-Clojure. The GET requests work fine, but…
Gregory-Turtle
  • 1,657
  • 3
  • 20
  • 30
24
votes
4 answers

How to write multilingual applications in Clojure?

I'm trying to figure out how to create a Compojure-based web-site with multilingual support. Is there any solutions like i18n or something like that?
jarik
  • 279
  • 3
  • 5
21
votes
3 answers

how does one _model_ data from relational databases in clojure?

I have asked this question on twitter as well the #clojure IRC channel, yet got no responses. There have been several articles about Clojure-for-Ruby-programmers, Clojure-for-lisp-programmers.. but what is the missing part is Clojure for…
Sandeep
  • 1,745
  • 3
  • 20
  • 30
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
  • 24,871
  • 19
  • 102
  • 158
17
votes
1 answer

Clojure Webapp in IntelliJ + Maven + Tomcat

I am working with a Compojure based Clojure web application in IntelliJ using Maven as my dependency manager. It is based on an application I found at this git repository referenced by this example. When I try to run the application using…
MplsAmigo
  • 985
  • 6
  • 21
17
votes
1 answer

Combining routes in Compojure

I have two different web applications in Clojure developed with Compojure. Each use defroutes to create its handler. How can I combine the two different definitions of defroutes into one defroute? I want to reuse the routes of the first app into the…
z1naOK9nu8iY5A
  • 903
  • 7
  • 22
17
votes
4 answers

Missing form parameters in Compojure POST request

I'm having problems getting the form parameters in the following Compojure example: (ns hello-world (:use compojure.core, ring.adapter.jetty) (:require [compojure.route :as route])) (defn view-form [] (str "" "
cretzel
  • 19,864
  • 19
  • 58
  • 71
17
votes
2 answers

How Can I Output an HTML Comment in Compojure/Hiccup?

I'd like my program to output the following HTML: Is there a way to output html comment literals with Hiccup?
Chris Bilson
  • 1,884
  • 1
  • 17
  • 20
17
votes
2 answers

Using Clojure with Vaadin

Has anyone tried implementing a web application with Clojure ( using Compojure ) and Vaadin ? I had seen an article on using Clojure with JWT for creating web apps. Vaadin is based on GWT so you get a lot of the advantages of GWT ( though Vaadin is…
Arun R
  • 8,372
  • 6
  • 37
  • 46
15
votes
3 answers

How to convert map to URL query string in Clojure/Compojure/Ring?

In Clojure / Compojure, how do I convert a map to a URL query string? {:foo 1 :bar 2 :baz 3} to foo=1&bar=2&baz=3 Is there any utility method to do this in compojure?
Sathish
  • 20,660
  • 24
  • 63
  • 71
1
2 3
29 30