Last active
December 17, 2015 00:09
-
-
Save PuercoPop/5518536 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(asdf:defsystem #:qchapi | |
:name "qchapi" | |
:description "A Restful Api for Qcha.es" | |
:author "Javier Olaechea <[email protected]>" | |
:version "20130401" | |
:serial t | |
:license "<3" | |
:depends-on (#:clack | |
#:ningle | |
#:yason | |
#:postmodern) | |
:pathname "src/" | |
:components ((:file "packages") | |
(:file "qchapi") | |
(:file "api") | |
(:file "models") | |
(:file "tables") | |
)) | |
(defpackage #:qchapi | |
(:use #:cl) | |
(:import-from :ningle :*response*)) | |
(in-package :qchapi) | |
(defvar *app* (make-instance 'ningle:<app>)) | |
;; Strat, parse json, look for word: argment, then look for definitions. | |
;; If present then process those, looking for definition field then examples. | |
;; If present process those | |
(setf (ningle:route *app* "/word/" :method :PUT) | |
#'(lambda (params) | |
(format nil "~a" (gethash "cat" (getf (clack.request:body-parameter ningle:*request*) :json))))) | |
(clack:clackup *app*) | |
;; then run curl -v -XPUT -d "{\"cat\": \"dog\"}" http://localhost:5000/word/ from the shell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment