Skip to content

sukuizhang/invoke-clojure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

invoke clojure functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published