diff --git a/FAQ b/FAQ index 51c2d5a..16cbf84 100644 --- a/FAQ +++ b/FAQ @@ -1,4 +1,10 @@ Q) I start my application and I don't see anything? It worked before! -A) Did you start the application / emacs and slime in the directory of clog? - By default that is /common-lisp/clog? +A) If running a tutorial or demo: + Did you start the application / emacs and slime in the directory of clog? + By default that is /common-lisp/clog? + + Or you can use (defparameter clog::*overide-static-root* #P"~/common-lisp/clog/static-files/") + to overide the static path in (clog:initialize) + + If running your own app. Make sure the :static-file key is set correctly on (clog:initialize) diff --git a/clog-system.lisp b/clog-system.lisp index 2c1cfcf..549cbe8 100644 --- a/clog-system.lisp +++ b/clog-system.lisp @@ -34,7 +34,8 @@ "Inititalize CLOG on a socket using HOST and PORT to serve BOOT-FILE as the default route to establish web-socket connections and static files located at STATIC-ROOT. If CLOG was already initialized and not shut -down, this function does the same as set-on-new-window." +down, this function does the same as set-on-new-window. If the variable +clog:*overide-static-root* is set STATIC-ROOT will be ignored." (if *on-new-window* (set-on-new-window on-new-window-handler) (progn @@ -44,7 +45,9 @@ down, this function does the same as set-on-new-window." :host host :port port :boot-file boot-file - :static-root static-root)))) + :static-root (if (boundp '*overide-static-root*) + *overide-static-root* + static-root))))) ;;;;;;;;;;;;;;;;;;;;;;; ;; set-on-new-window ;; diff --git a/tutorial/11-tutorial.lisp b/tutorial/11-tutorial.lisp index 90906c3..5299e1e 100644 --- a/tutorial/11-tutorial.lisp +++ b/tutorial/11-tutorial.lisp @@ -15,7 +15,6 @@ ;; and added CLOG's boot.js script line. It was neccesary to add an id to the ;; form (id='form1') as the generator did not add one. ;; -;; - We tell clog to use the boot file "/tutorial/tut-11.html" ;; - We set a blank on-submit to overide the behavior in the bootstrap ;; buttons to submit the from HTML style. ;; - We are going to attach to the "Good Button" an on-click handler @@ -24,6 +23,10 @@ ;; value for and query them ;; - We attach an on-click handler that resets the form to the ;; "Scary Button" +;; +;; - We go in the browser to the file +;; "http://127.0.0.1:8080/tutorial/tut-11.html" + (defpackage #:clog-user (:use #:cl #:clog) @@ -68,5 +71,5 @@ (defun start-tutorial () "Start turtorial." - (initialize #'on-new-window :boot-file "/tutorial/tut-11.html") - (open-browser)) + (initialize #'on-new-window) + (open-browser :url "http://127.0.0.1:8080/tutorial/tut-11.html"))