File tree Expand file tree Collapse file tree 2 files changed +22
-23
lines changed Expand file tree Collapse file tree 2 files changed +22
-23
lines changed Original file line number Diff line number Diff line change 14
14
(when @*server
15
15
(main/stop-server @*server)
16
16
(reset! *server nil )))
17
+
18
+ (comment
19
+ (start-server )
20
+ (stop-server ))
21
+
22
+
23
+ (comment ; test web api
24
+ (require '[clojure.java.shell :refer [sh]])
25
+
26
+ (sh " curl" " -X" " POST"
27
+ " -H" " Content-Type: application/json"
28
+ " http://localhost:8000/"
29
+ " -d" " {\" url\" : \" https://clojurescript.org/\" }" )
30
+
31
+ (sh " curl" " -X" " PUT"
32
+ " -H" " Content-Type: application/json"
33
+ " http://localhost:8000/clj"
34
+ " -d" " {\" url\" : \" https://clojure.org/\" }" )
35
+
36
+ (sh " curl" " -i" " http://localhost:8000/clj" )
37
+
38
+ (sh " curl" " http://localhost:8000/list/" ))
Original file line number Diff line number Diff line change 21
21
(.addShutdownHook
22
22
(Runtime/getRuntime )
23
23
(Thread. ^Runnable #(stop-server server)))))
24
-
25
- (comment
26
- (def server (start-server {:port 8000 :join? false }))
27
- (stop-server server)
28
-
29
- (require '[clojure.java.shell :refer [sh]])
30
-
31
- (sh " curl" " -X" " POST"
32
- " -H" " Content-Type: application/json"
33
- " http://localhost:8000/"
34
- " -d" " {\" url\" : \" https://clojurescript.org/\" }" )
35
-
36
- (sh " curl" " -X" " PUT"
37
- " -H" " Content-Type: application/json"
38
- " http://localhost:8000/clj"
39
- " -d" " {\" url\" : \" https://clojure.org/\" }" )
40
-
41
- (sh " curl" " -i" " http://localhost:8000/clj" )
42
-
43
- (sh " curl" " http://localhost:8000/list/" )
44
- )
45
-
46
-
You can’t perform that action at this time.
0 commit comments