Skip to content

Latest commit

 

History

History
74 lines (59 loc) · 1.78 KB

demo.org

File metadata and controls

74 lines (59 loc) · 1.78 KB

REST SERVER DEMO

Load the demo

(ql:quickload :rest-server-demo)

Start the demo api

(rest-server-demo:start-demo-api)

Access the api via the generated client functions

(rs:with-api-backend "http://localhost:9090"
  (rest-server-demo.client:list-users))
((:PAGE . 1) (:NEXT . "http://localhost:9090/users?page=2&expand=")
 (:PREVIOUS . "http://localhost:9090/users?page=0&expand=") (:RESULTS))
200
(rs:with-api-backend "http://localhost:9090"
  (rest-server-demo.client:create-user nil))
((:ID . 2) (:REALNAME))
200
(rs:with-api-backend "http://localhost:9090"
  (rest-server-demo.client:create-user '((:realname . "Mariano"))))
((:ID . 4) (:REALNAME . "Mariano"))
200
(rs:with-api-backend "http://localhost:9090"
  (rest-server-demo.client:list-users))
((:PAGE . 1) (:NEXT . "http://localhost:9090/users?page=2&expand=")
 (:PREVIOUS . "http://localhost:9090/users?page=0&expand=")
 (:RESULTS ((:ID . 4) (:REALNAME . "Mariano"))
  ((:ID . 3) (:REALNAME . "Mariano")) ((:ID . 2) (:REALNAME))))
200
(rs:with-api-backend "http://localhost:9090"
  (rest-server-demo.client:fetch-user 3))
((:HREF . "http://localhost:9090/users/3") (:ID . 3) (:REALNAME . "Mariano"))
200