29 lines
1.2 KiB
Common Lisp
Executable File
29 lines
1.2 KiB
Common Lisp
Executable File
(cl:defpackage :TEST-CLASH (:USE :CL :CLASH))
|
|
(cl:in-package :TEST-CLASH)
|
|
(eval-when (:compile-toplevel :load-toplevel :execute) (enable-clash-syntax))
|
|
(defparameter *my-server* (make-instance 'http-server/1.0))
|
|
(apply #'export-files *my-server* "image/jpeg" #u"/img/"
|
|
(let ((*default-pathname-defaults* (merge-pathnames #P"../doc/" *load-pathname*)))
|
|
(directory "*.jpg")))
|
|
(export-resource
|
|
*my-server* #u"/index.html"
|
|
'static-resource
|
|
:entity
|
|
(make-instance 'string-entity
|
|
:body
|
|
(format nil
|
|
"<!DOCTYPE html>~%~
|
|
<html>~
|
|
<head><title>Simple CLASH Test Page on ~A ~A</title></head>~
|
|
<body style='background-color: #000000; color: #ffffff'>~
|
|
<img src='img/logo2.jpg'/>~
|
|
<h1>Test Page on ~2:*~A ~A</h1>~
|
|
<p>Hi!</p>~
|
|
</body>~
|
|
</html>"
|
|
(lisp-implementation-type)
|
|
(lisp-implementation-version))))
|
|
(start-http-listener 3080 *my-server*)
|
|
(initialize-clash)
|
|
(eval-when (:compile-toplevel :load-toplevel :execute) (disable-clash-syntax))
|