about summary refs log tree commit diff stats
path: root/cecho.lisp
blob: d5c61b66bdd78d4ef4d675eb8309b0dfa492da10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
(ql:quickload "jsonrpc")
(require "jsonrpc")
(defun main ()
  (let ((server (jsonrpc:make-server)))
    (jsonrpc:expose server "subtract" (lambda (args)
                                        (- (gethash "l" args) (gethash "r" args))))
    (jsonrpc:expose server "add" (lambda (args)
                                   (+ (gethash "l" args) (gethash "r" args))))
    (jsonrpc:expose server "quit" (lambda (args) (quit)))
    (jsonrpc:server-listen server :port 8192 :mode :tcp)))