From 83294f1d9627d60f609eaeb7ca43d62b6fde698d Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Sun, 14 Aug 2022 17:49:23 +0100 Subject: [PATCH] add config. code for DB in prod. and clack middleware debug. --- app.lisp | 4 +++- src/config.lisp | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app.lisp b/app.lisp index 9886106..6c785d5 100644 --- a/app.lisp +++ b/app.lisp @@ -38,4 +38,6 @@ (let ((datafly:*trace-sql* t)) (funcall app env))))) *web*) - :debug t) + :debug (if (hot-line.config:productionp) + nil + t)) ; Added as part of clack-error-middleware. diff --git a/src/config.lisp b/src/config.lisp index 8ed7377..c993173 100644 --- a/src/config.lisp +++ b/src/config.lisp @@ -27,7 +27,11 @@ '()) (defconfig |production| - '()) + `(:debug nil + :databases + ((:maindb :sqlite3 :database-name ,(merge-pathnames #P"db/hot-line.db" + *application-root*))))) + (defconfig |test| '()) @@ -43,3 +47,8 @@ (defun productionp () (string= (appenv) "production")) + +;;; Use this to change the environment between "development" and +;;; "production". This change is mostly to specifiy which database the +;;; system will use. +(setf (osicat:environment-variable "APP_ENV") "development")