|
|
@@ -5,7 +5,8 @@
|
|
|
|
|
|
(in-package :cl-user)
|
|
|
(restas:define-module #:timeliner.web
|
|
|
- (:use :cl :parenscript #:timeliner.utils))
|
|
|
+ (:use :cl :parenscript #:timeliner.utils)
|
|
|
+ (:export #:*mongo-db* #:*mongo-host*))
|
|
|
(in-package #:timeliner.web)
|
|
|
|
|
|
(restas::register-pkgmodule-traits 'timeliner.web
|
|
|
@@ -21,12 +22,16 @@
|
|
|
"List of cron functions with their schedules")
|
|
|
(defvar *cron-timers* nil)
|
|
|
|
|
|
+;; db settings
|
|
|
+(defvar *mongo-host* nil "mongo db host name")
|
|
|
+(defvar *mongo-db* nil "mongo db database name")
|
|
|
+
|
|
|
(defmethod restas:initialize-module-instance :before ((module (eql #.*package*)) context)
|
|
|
(restas:with-context context
|
|
|
(alexandria:when-let (file (probe-file "config.lisp"))
|
|
|
(load file))
|
|
|
- (cl-mongo:mongo :host "10.8.0.6")
|
|
|
- (cl-mongo:db.use "timeline")
|
|
|
+ (cl-mongo:mongo :host *mongo-host*)
|
|
|
+ (cl-mongo:db.use *mongo-db*)
|
|
|
(when *run-cron*
|
|
|
(restas:context-add-variable
|
|
|
context '*cron-timers*
|