Skip to content

Commit 618a510

Browse files
committed
initial commit
0 parents  commit 618a510

File tree

13 files changed

+28078
-0
lines changed

13 files changed

+28078
-0
lines changed

.classpath

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
4+
<classpathentry kind="src" path="src/clj">
5+
<attributes>
6+
<attribute name="optional" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="src" path="test">
10+
<attributes>
11+
<attribute name="optional" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="src" path="dev-resources">
15+
<attributes>
16+
<attribute name="optional" value="true"/>
17+
</attributes>
18+
</classpathentry>
19+
<classpathentry kind="src" path="resources">
20+
<attributes>
21+
<attribute name="optional" value="true"/>
22+
</attributes>
23+
</classpathentry>
24+
<classpathentry kind="lib" path="target/classes">
25+
<attributes>
26+
<attribute name="optional" value="true"/>
27+
</attributes>
28+
</classpathentry>
29+
<classpathentry exported="true" kind="con" path="ccw.LEININGEN_CONTAINER">
30+
<attributes>
31+
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="cloodle/target/native/linux/x86_64"/>
32+
</attributes>
33+
</classpathentry>
34+
<classpathentry exported="true" kind="lib" path="classes">
35+
<attributes>
36+
<attribute name="optional" value="true"/>
37+
</attributes>
38+
</classpathentry>
39+
<classpathentry kind="output" path="bin"/>
40+
</classpath>

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/target
2+
/lib
3+
/classes
4+
/checkouts
5+
*.jar
6+
*.class
7+
/.lein-*
8+
/.nrepl-port
9+
10+
11+

.project

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>cloodle</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>ccw.builder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>ccw.leiningen.builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.jdt.core.javabuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
</buildSpec>
24+
<natures>
25+
<nature>org.eclipse.jdt.core.javanature</nature>
26+
<nature>ccw.leiningen.nature</nature>
27+
<nature>ccw.nature</nature>
28+
</natures>
29+
</projectDescription>

bin/cloodle/server.clj

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
(ns cloodle.server
2+
(:require [ring.adapter.jetty :as jetty]
3+
[ring.middleware.resource :as resources]
4+
[ring.util.response :as response])
5+
(:gen-class))
6+
7+
(defn render-app []
8+
{:status 200
9+
:headers {"Content-Type" "text/html"}
10+
:body
11+
(str "<!DOCTYPE html>"
12+
"<html>"
13+
"<head>"
14+
"<link rel=\"stylesheet\" href=\"css/page.css\" />"
15+
"</head>"
16+
"<body>"
17+
"<div>"
18+
"<p id=\"clickable\">Click me!</p>"
19+
"</div>"
20+
"<script src=\"js/cljs.js\"></script>"
21+
"</body>"
22+
"</html>")})
23+
24+
(defn handler [request]
25+
(if (= "/" (:uri request))
26+
(response/redirect "/help.html")
27+
(render-app)))
28+
29+
(def app
30+
(-> handler
31+
(resources/wrap-resource "public")))
32+
33+
(defn -main [& args]
34+
(jetty/run-jetty app {:port 3000}))
35+

bin/public/css/page.css

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
body {
2+
width: 900px;
3+
margin: 0 auto;
4+
background-color: #8eba8e;
5+
}
6+
7+
div {
8+
background: green;
9+
margin: 3em;
10+
padding: 1em;
11+
border: 1px solid gray;
12+
background-color: #baf0ba;
13+
}

bin/public/help.html

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<link rel="stylesheet" href="css/page.css" />
5+
</head>
6+
<body>
7+
<div>
8+
<p>Congratulations on your new cljs-kickoff template!</p>
9+
<p>This is a static page, served from plain files in resoures/public. You
10+
can place other static resources here. Your ClojureScript files will be
11+
compiled to the same folder.</p>
12+
<p>The project has two files:<p>
13+
<ul>
14+
<li><code>src/clj/cloodle/server.clj</code> - it starts up Ring web server
15+
and serves dynamic content.</li>
16+
<li><code>src/cljs/cloodle/client.cljs</code> - this ClojureScript file
17+
is compiled to JavaScript.</li>
18+
</ul>
19+
<p><a href="/app">Click here</a> to access the application.</p>
20+
</div>
21+
</body>
22+
</html>

0 commit comments

Comments
 (0)