-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
41 lines (29 loc) · 1.56 KB
/
README
File metadata and controls
41 lines (29 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
invoke
simple invoke clj tools.
Usage
ServerSide:
1.add dependency [invoke-clojure "0.0.1"] into your project.clj.
2.write your functions in your xyz.clj...
3.in your main.clj, you can require or use your other namespace.
4.add require [invoke-clojure.core :as invoke], and execute:
(invoke/start & [your options])
then start invoke server.
5.options:
:ns special your namespace to be invoke, any of function that can directly visit in this namespace can be invoke from client side, include that you write in this namespace and functions in namespace that you has use or require.
:remove-ns special namespace that you do not want to visit it, default, clojure.core and invoke-clojure.core is exclude.
:port server start port.
6.sample functons and urls:
in example.example1:
(defn f4 ([u v w] [u v w]) ([a b] [a b]))
(defn person [name sex age] {:name name :sex sex :age age})
in example.example:
(defn f4 ([u v w] [u v w]) ([a b] [a b]))
(defn person [name sex age] {:name name :sex sex :age age})
and we example.example,we require [example.example1 :as example1]
we invoke these functions in example.example,follow is the corresponding urls:
http://localhost:8080/f4?u=3&v=4&w=13&arg-index=0
http://localhost:8080/f4_1?a=7&b=8
http://localhost:8080/person?name="zrr"&sex=:female&age=29
http://localhost:8080/example1/f1?af4?u=3&v=4&w=13&arg-index=0
http://localhost:8080/example1/f1?af4_1?a=7&b=8
http://localhost:8080/example1/f1?aperson?name="zrr"&sex=:female&age=29