;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- ;;; $Header: src/frontend/main.lisp $ ;;; Copyright (c) 2008, Andrea Chiumenti. All rights reserved. ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; * Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; * Redistributions in binary form must reproduce the above ;;; copyright notice, this list of conditions and the following ;;; disclaimer in the documentation and/or other materials ;;; provided with the distribution. ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (in-package :claw-demo-frontend) (defvar *main-file* (load-time-value (or #.*compile-file-pathname* *load-pathname*))) (defvar *dojo-demo-lisplet*) (setf *dojo-demo-lisplet* (make-instance 'lisplet :realm 'demo :redirect-protected-resources-p t :base-path "/demo")) (defvar *ht-connector* (make-instance 'hunchentoot-connector :address "localhost" :port 4242 :sslport nil;4343 #| :ssl-certificate-file #P "/etc/apache2/ssl/server.crt" :ssl-privatekey-file #P "/etc/apache2/ssl/server.key" |#)) (defvar *sm* (make-instance 'default-session-manager)) (defvar *ht-log-manager* (make-instance 'hunchentoot-logger)) (defvar *dojo-claw-server* (make-instance 'claw-server :connector *ht-connector* :log-manager *ht-log-manager* :session-manager *sm* :base-path "/claw" :reverse-proxy-path "/claw1")) (claw-server-register-lisplet *dojo-claw-server* *dojo-demo-lisplet*) (claw-server-register-configuration *dojo-claw-server* 'demo (make-instance 'demo-configuration)) (let ((path (make-pathname :directory (append (pathname-directory *main-file*) '("docroot")))) (*claw-server* *dojo-claw-server*)) (log-message :info "Registering resource ~a" path) (lisplet-register-resource-location *dojo-demo-lisplet* path "docroot/")) (defun djstart () (claw-server-start *dojo-claw-server*)) (defun djstop () (claw-server-stop *dojo-claw-server*))