( 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!