2

The question is: is there a way to get or compile a website written in clojure to HTML and Javascript files without having .WAR file for the server? Thank you.

3
  • 1
    do you mean to generate static HTML ? Commented Feb 13, 2013 at 23:16
  • could you describe some example input/code and what the expected result would be? Commented Feb 13, 2013 at 23:20
  • I really like how I can use clojure and Noir to create a website (still learning), but I was wondering if there is a way not to use .war files, so that any server will understand the regular html, css and javascript. Commented Feb 14, 2013 at 16:55

2 Answers 2

3

For that you may want to look into writing the site in ClojureScript. It's a different language though very similar to Clojure. This would make it possible to write the entire site using client side java script and static resources like HTML, CSS, Images, etc. Or you could use node to run the generated server side JavaScript.

Another option, depending on how I interpret your question would be to write it as a dynamic site in Clojure, then spider the whole thing using wget and save a static snapshot of it. Though perhaps that's not what you where asking for? You could also use Hickup or Enlive to create templates and then run the templates to produce html that you serve statically with no app server or dynamic content.

Sign up to request clarification or add additional context in comments.

2 Comments

I am thinking of a dynamic site, but without the use of .war files, bcause I can not find free hosting with tomcat, therefore is there a way to compile the code in to html + css + javascript (if it is possible)?
have you looked at Heroku.com their Clojure support is fairly easy, you just push a lein project to them with git and they host it. (they have a free usage level)
3

If you want to create a static site, there are couple of options,

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.