Created
November 5, 2011 18:08
-
-
Save peccu/1341832 to your computer and use it in GitHub Desktop.
This file contains 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
;;; Clackでwebアプリ | |
;; Clackをロード | |
(ql:quickload :clack) | |
;; パッケージとして宣言? | |
(defpackage simple-app | |
(:use :cl | |
:clack)) | |
(in-package :simple-app) | |
;; アプリの動作を記述 | |
(defvar app | |
#'(lambda (env) | |
;; "envを宣言だけで使ってない"という警告を止めるためと思う.たぶん | |
(declare (ignore env)) | |
;; 200の時の処理 | |
'(200 | |
;; header | |
(:content-type "text/plain") | |
;; body | |
;; 要するにここに処理を書けばwebアプリになる | |
;; envにクライアント側の情報とか入ってる | |
;; http://clacklisp.org/doc/#The%20Environment 参照 | |
("Hello, Clack!")))) | |
;; 上で書いたアプリをclackupで起動する | |
(defvar *handler* | |
(clackup app | |
;; ;; apacheとmod_lispで会話する時はコメントアウトをはずす | |
;; ;; ローカルで試すだけならコメントのまま | |
;; :server :apache | |
:port 5000 | |
:debug t)) | |
;; *handler*にハンドラが入ったので | |
;; (clack:stop *handler*) | |
;; で止められる |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment