A website for producing interactive charts without writing a single line of code. Built with Common Lisp and Python.
https://charts.craigoates.net
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.
45 lines
1.2 KiB
45 lines
1.2 KiB
;; (in-package :cl-user) |
|
(defpackage hot-line.config |
|
(:use :cl) |
|
(:import-from :envy |
|
:config-env-var |
|
:defconfig) |
|
(:export :config |
|
:*application-root* |
|
:*static-directory* |
|
:*template-directory* |
|
:appenv |
|
:developmentp |
|
:productionp)) |
|
(in-package :hot-line.config) |
|
|
|
(setf (config-env-var) "APP_ENV") |
|
|
|
(defparameter *application-root* (asdf:system-source-directory :hot-line)) |
|
(defparameter *static-directory* (merge-pathnames #P"static/" *application-root*)) |
|
(defparameter *template-directory* (merge-pathnames #P"templates/" *application-root*)) |
|
|
|
(defconfig :common |
|
`(:application-root ,(asdf:component-pathname (asdf:find-system :hot-line)) |
|
:databases ((:maindb :sqlite3 :database-name ,(merge-pathnames #P"db/hot-line.db"))))) |
|
|
|
(defconfig |development| |
|
'()) |
|
|
|
(defconfig |production| |
|
'()) |
|
|
|
(defconfig |test| |
|
'()) |
|
|
|
(defun config (&optional key) |
|
(envy:config #.(package-name *package*) key)) |
|
|
|
(defun appenv () |
|
(uiop:getenv (config-env-var #.(package-name *package*)))) |
|
|
|
(defun developmentp () |
|
(string= (appenv) "development")) |
|
|
|
(defun productionp () |
|
(string= (appenv) "production"))
|
|
|