You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.7 KiB
68 lines
1.7 KiB
2 years ago
|
(ql:quickload :rails-to-caveman)
|
||
|
|
||
|
(defpackage rails-to-caveman.app
|
||
|
(:use :cl)
|
||
|
(:import-from :lack.builder
|
||
|
:builder)
|
||
|
(:import-from :ppcre
|
||
|
:scan
|
||
|
:regex-replace)
|
||
|
(:import-from :rails-to-caveman.web
|
||
|
:*web*)
|
||
|
(:import-from :rails-to-caveman.config
|
||
|
:config
|
||
|
:productionp
|
||
|
:*static-directory*))
|
||
|
(in-package :rails-to-caveman.app)
|
||
|
|
||
|
;;; ORIGINAL -- WITHOUT CLACK-ERRORS PACKAGE ADDED
|
||
|
;; (builder
|
||
|
;; (:static
|
||
|
;; :path (lambda (path)
|
||
|
;; (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)))))
|
||
|
;; *web*)
|
||
|
|
||
|
|
||
|
;;; ADDED AS PART OF CLACK-ERRORS PACKAGE ADDITION
|
||
|
(funcall clack-errors:*clack-error-middleware* ; <--- This and...
|
||
|
(builder
|
||
|
(:static
|
||
|
:path (lambda (path)
|
||
|
(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)))))
|
||
|
*web*)
|
||
|
:debug t) ; <--- This!
|