3 (in-package :common-lisp-user
)
7 ;; this isn't strictly necessary, but scheduling feels very coarse
8 ;; without startup-idle-and-top-level-loops, leading to answer delays
9 ;; of about 1s per request.
11 #'(lambda (proc) (string= (mp:process-name proc
) "Top Level Loop"))
13 (mp::startup-idle-and-top-level-loops
)))
18 ;;;; * UCW server initialization "script"
20 ;;;; This file is meant to be loaded by ucwctl, but you can use it a
21 ;;;; general "startup ucw" file as well. You should customize this
22 ;;;; script to load/prepare your application.
24 ;;;; ** Loadup dependencies
26 ;;;; Load arnesi first so we can set arnesi::*call/cc-returns* before
27 ;;;; ucw is compiled and loaded.
28 (asdf:oos
'asdf
:load-op
:arnesi
)
29 (setf arnesi
::*call
/cc-returns
* nil
)
31 ;;;; Load up UCW itself
32 (asdf:oos
'asdf
:load-op
:ucw
)
34 (in-package :it.bese.ucw-user
)
36 #+(and sbcl sb-unicode
)
37 (setf (external-format-for :slime
) :utf-8-unix
38 (external-format-for :url
) :utf-8
39 (external-format-for :http-emacsen
) :utf-8-unix
40 (external-format-for :http-lispish
) :utf-8
)
42 ;;;; Load the default applications systems
44 (asdf:oos
'asdf
:load-op
:ucw.examples
)
45 (asdf:oos
'asdf
:load-op
:ucw.admin
)
46 (asdf:oos
'asdf
:load-op
:lisp-on-lines
)
47 (asdf:oos
'asdf
:load-op
:lisp-on-lines.example
)
49 ;;;; Let there be swank.
50 (swank:create-server
:port
4007)
52 ;;;; Finally startup the server
54 ;;;; ** Finally startup the server
56 (ucw:create-server
:backend
:araneida
61 :host
"merlin.tech.coop"
64 lol
::*lol-example-application
*)
65 :inspect-components nil
66 :log-root-directory
(make-pathname :name nil
:type nil
67 :directory
(append (pathname-directory *load-truename
*)
69 :defaults
*load-truename
*)
73 ;;;; ** Allocate one database connection per thread :
75 (defmethod araneida:handle-request-response
:around
((handler ucw
::ucw-handler
) method request
)
76 (clsql:with-database
(my-db '("localhost" "lol" "lol" "lol") :pool t
)
77 (clsql:with-default-database
(my-db)
80 (publish-directory (server.backend
*default-server
*) #P
"/home/drewc/src/site/lisp-on-lines/wwwroot/dojo/" "/dojo/")
81 (publish-directory (server.backend
*default-server
*) #P
"/home/drewc/src/site/lisp-on-lines/wwwroot/prototype/" "/prototype/")
83 (publish-directory (server.backend
*default-server
*) #P
"/home/drewc/src/sunrise/wwwroot/" "/")