Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f980718

Browse files
author
Kapil Reddy
committed
Minor formatting changes in core ns
1 parent 2959578 commit f980718

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

‎src/icw/core.clj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,27 @@
44
[icw.data.process-faster]
55
[icw.web.core :as web]))
66

7+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8+
;; Introduction
9+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
710

811
;; Start HTTP server
912

1013
(comment
1114
(system/start!))
1215

13-
16+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1417
;; Chapter 1 - Lazy sequences
18+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1519

1620
;; http://localhost:6789/albums
1721

1822
;; Where is it located ? Let's jump there
1923
web/app
2024

25+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2126
;; Chapter 2 - Concurrency
27+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2228

2329
;; Can we make make populate-db faster?
2430

‎src/icw/web/core.clj

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
1-
;; [[file:~/github/intermediate-clojure-workshop/content/web/core.org::*The%20Preamble][The Preamble:1]]
21
(ns icw.web.core
32
(:require [compojure.core :as c]
43
[aleph.http :as http]
54
[ring.middleware
65
[keyword-params :refer [wrap-keyword-params]]
76
[params :refer [wrap-params]]
87
[json :refer [wrap-json-response]]]
8+
[icw.web.handlers.albums :as albums]
99
[icw.search.core :as search]))
1010

1111
(defn wrap-body [response-body]
1212
{:status 200
1313
:body response-body})
14-
;; The Preamble:1 ends here
1514

16-
;; [[file:~/github/intermediate-clojure-workshop/content/web/core.org::*The%20Albums%20Context][The Albums Context:1]]
1715
(def albums-context
1816
(c/context "/albums" [:as request]
1917
(c/GET "/" []
2018
(wrap-body
21-
{:message"Here be your JSON-ful of albums"}))
19+
(albums/list-albums)))
2220
(c/GET "/:id" [id]
2321
(wrap-body {:message (str "Here be your JSON of an album with id " id)}))))
24-
;; The Albums Context:1 ends here
2522

26-
;; [[file:~/github/intermediate-clojure-workshop/content/web/core.org::*The%20Search%20Context][The Search Context:1]]
2723
(def search-context
2824
(c/context "/search" [:as request]
2925
(c/GET "/:term" [term]
@@ -32,12 +28,10 @@
3228
(or
3329
(search/search (keyword field) term)
3430
(wrap-body {:message (str "Looking for " term " in field " field ", eh?")}))))))
35-
;; The Search Context:1 ends here
3631

37-
;; [[file:~/github/intermediate-clojure-workshop/content/web/core.org::*Tying%20Together][Tying Together:1]]
3832
(c/defroutes app*
39-
albums-context
40-
search-context)
33+
albums-context
34+
search-context)
4135

4236
(def app
4337
(c/routes

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /