Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (ql:quickload :caveman-jscl)
- (defpackage caveman-jscl.app
- (:use :cl)
- (:import-from :lack.builder
- :builder)
- (:import-from :ppcre
- :scan
- :regex-replace)
- (:import-from :caveman-jscl.web
- :*web*)
- (:import-from :caveman-jscl.config
- :config
- :productionp
- :*static-directory*
- :*base-url*))
- (in-package :caveman-jscl.app)
- (builder
- (:static
- :path (lambda (path)
- ;; /caveman/css/main.css にアクセスすると path に /caveman/css/main.css が入るようで、404となる
- ;; ここで /caveman を削ると main.cssの内容がレスポンスされる
- (if (ppcre:scan "^(?:/images/|/css/|/js/|/robot\\.txt$|/favicon\\.ico$)" path)
- path
- nil))
- :root *static-directory*)
- (if (productionp)
- nil
- :accesslog)
- (if (getf (config) :error-log)
- `(:backtrace
- :output ,(getf (config) :error-log))
- nil)
- :session
- (if (productionp)
- nil
- (lambda (app)
- (lambda (env)
- (let ((datafly:*trace-sql* t))
- (funcall app env)))))
- (:mount *base-url* *web*) ; 引数の数違うと怒られたので、mount-appに*web*を渡した
- *web*)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement