Modernize silly example somewhat.

This commit is contained in:
2016-09-15 11:51:37 +02:00
parent 1395705040
commit 531e905389

View File

@ -1,7 +1,10 @@
(cl:defpackage :TEST-CLASH (:USE :CL :CLASH)) (cl:defpackage :TEST-CLASH (:USE :CL :CLASH))
(cl:in-package :TEST-CLASH) (cl:in-package :TEST-CLASH)
(eval-when (:compile-toplevel :load-toplevel :execute) (enable-clash-syntax)) (eval-when (:compile-toplevel :load-toplevel :execute) (enable-clash-syntax))
(defvar *my-server* (make-instance 'http-server/1.0)) (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 (export-resource
*my-server* #u"/index.html" *my-server* #u"/index.html"
'static-resource 'static-resource
@ -9,13 +12,15 @@
(make-instance 'string-entity (make-instance 'string-entity
:body :body
(format nil (format nil
"<HTML>~ "<!DOCTYPE html>~%~
<HEAD><TITLE>Simple CLASH Test Page on ~A ~A</TITLE></HEAD>~ <html>~
<BODY BGCOLOR='#eeeeff'>~ <head><title>Simple CLASH Test Page on ~A ~A</title></head>~
<H1>Test Page on ~2:*~A ~A</H1>~ <body style='background-color: #000000; color: #ffffff'>~
<P>Hi!</P>~ <img src='img/logo2.jpg'/>~
</BODY>~ <h1>Test Page on ~2:*~A ~A</h1>~
</HTML>" <p>Hi!</p>~
</body>~
</html>"
(lisp-implementation-type) (lisp-implementation-type)
(lisp-implementation-version)))) (lisp-implementation-version))))
(start-http-listener 3080 *my-server*) (start-http-listener 3080 *my-server*)