2 ;;; In the :lineal.webui package.
4 (format t
"serv.lisp is loading...~%")
6 (format t
"Using ASDF, you better have it loaded already...~%")
8 (format t
"... looks like it worked.~%")
10 (format t
"Loading package dependencies.~%")
12 ;V Load the required libraries using V
13 ;V functions best with the lisp. V
16 (format t
"Loading ~A...~%" pkg
)
17 #+(or :sbcl
:mcl
:ecl
:cmucl
)
19 #-
(or :sbcl
:mcl
:ecl
:cmucl
)
20 (asdf:operate
'asdf
:load-op pkg
)
21 (format t
"... ~A loaded.~%" pkg
))
22 (list :hunchentoot
:cl-who
:parenscript
))
24 (format t
"Compiling and loading source tree...~%")
26 (compile-lineal :compile-all
(boundp 'compile-all
))
28 (format t
"Generating JavaScript files if needed...~%")
29 (lineal.webui
::recompile-ps
)
30 (format t
"... success! We are now w3c complaint!~%")
32 ;V Enact any config options.V
33 (when (boundp 'tmp-directory
)
34 (ensure-directories-exist
35 (symbol-value 'tmp-directory
))
36 (setf lineal.webui
::*tmp-directory
*
37 (symbol-value 'tmp-directory
))
38 (format t
"Custom tmp directory set to: ~A~%"
39 (truename (symbol-value 'tmp-directory
))))
41 (when (boundp 'log-file
)
42 (open (ensure-directories-exist
43 (symbol-value 'log-file
))
44 :direction
:probe
:if-does-not-exist
:create
)
45 (setf (lineal.webui
::log-file
)
46 (symbol-value 'log-file
))
47 (format t
"Custom log file will be at: ~A~%"
48 (truename (symbol-value 'log-file
))))
50 ;V Load up restore file.V
51 (when (boundp 'restore-from-file
)
52 (let ((file (symbol-value 'restore-from-file
)))
53 (unless (pathnamep file
)
54 (setq file
(make-pathname :name
"captured_session")))
55 (format t
"Restoring session from: \"~A\"...~%"
57 (princ (lineal::local-restore file
))
60 ;V Start server at specified port. V
61 (let ((the-port (if (boundp 'port
)
62 (symbol-value 'port
) 41938)))
63 (format t
"Starting Lineal on port ~A... " the-port
)
64 (lineal.webui
:start-server
:port the-port
)
65 (format t
"OK~%Now point your bowser to ~
66 http://localhost:~A/ and have at it!~%"
69 (import 'lineal
::local-capture
:cl-user
)