diff options
author | Colin Okay <colin@cicadas.surf> | 2022-10-28 14:49:12 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-10-28 14:49:12 -0500 |
commit | 6d2f5539a5d401856e13c87f34daf4f951cc7c6e (patch) | |
tree | b60eb8aa6acf59ebf39a0e2db59355a6b35e6d1e /vampire.lisp | |
parent | 7017fb6cd063075f9c05a92dad8446b27b484a4e (diff) |
Add: sample config; destroy playlist; cli startup
Diffstat (limited to 'vampire.lisp')
-rw-r--r-- | vampire.lisp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/vampire.lisp b/vampire.lisp index f149255..16665fc 100644 --- a/vampire.lisp +++ b/vampire.lisp @@ -7,8 +7,9 @@ (defvar *config* nil) (defclass/std config () - ((datastore-directory :ir :std #P"/srv/parasite/store/") - (static-directory :ir :std #P"/srv/parasite/static/") + ((datastore-directory :ir :std #P"/srv/vampire/store/") + (static-directory :ir :std #P"/srv/vampire/static/") + (swank-port :std nil :doc "If set, swank is started on this port.") (port :ir :std 4919) (downloader-threads :ir :std 5))) @@ -39,11 +40,13 @@ (defun when-logged-in? (fn) (<?> 'session-user fn 'redirect-to-root)) -(defun start (config) +(defun start-vampire (config) (setf *config* config) (initialize-database config ) (start-downloader-service config) - (initialize 'main + (clog:initialize 'main + :port (port config) + :host "localhost" :extended-routing t :static-root (static-directory config)) (set-on-new-window (when-logged-in? 'user-home-page) :path "/home") @@ -51,10 +54,16 @@ (set-on-new-window (when-logged-in? 'playlist-page) :path "/playlist") (set-on-new-window 'new-accout-page :path "/new-account") (set-on-new-window (when-logged-in? 'explore-page) :path "/explore") - (open-browser)) + + (when (swank-port config) + (swank:create-server :port (swank-port config)))) (defun hacking-start () - (start (make-instance - 'config - :static-directory (merge-pathnames "vampire-static/" (user-homedir-pathname)) - :datastore-directory (merge-pathnames "vampire-store/" (user-homedir-pathname))))) + (start-vampire (make-instance + 'config + :static-directory (merge-pathnames "vampire-static/" (user-homedir-pathname)) + :datastore-directory (merge-pathnames "vampire-store/" (user-homedir-pathname)))) + (clog:open-browser)) + + + |