Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

unbreak the live comment updates, update the readme and mark mopoko a…

…s prerelease
  • Loading branch information...
commit 80fc2857a457a7800582fe8825ca6ffaace998e6 1 parent 1186386
John Fremlin authored
26 README
View
@@ -1,7 +1,32 @@
+-- What's this?
+
teepeedee2 is a webapplication framework for dynamic webpages. I made
it to see whether it was possible to write a high performance
application in Lisp. There were many obstacles in the way.
+-- Getting started
+
+Very rough notes!
+
+Start sbcl (note that the server at john.freml.in is actually running on CCL).
+
+(require 'asdf-install)
+(loop for x in '(:cffi
+ :iterate
+ :cl-irregsexp
+ :trivial-backtrace) (asdf-install:install x))
+
+(in-package #:tpd2)
+(loop for port in '(8888) do
+ (let ((socket (tpd2.io:make-con-listen :port port)))
+ (tpd2.io:launch-io 'tpd2.io:accept-forever socket 'tpd2.http:http-serve)))
+
+(tpd2.io:event-loop)
+
+
+
+-- More info
+
This webserver is not finished and I wrote it to learn and experiment
with Common Lisp. There is a lot to be tidied up, now I know the
language better. If you have any interest in using it, please get in
@@ -26,6 +51,7 @@ generating XML/HTML (tpd2.ml2), for doing fast networking in a
continuation passing style, i.e. fast event driven userspace
threading (tpd2.io).
+
For an example application, loaded by default, see the src/game directory.
The addons/ directory contains a few of the other projects (but not
2  src/game/web.lisp
View
@@ -296,7 +296,7 @@
(<h1 :class "mopoko"
(<A :href (page-link "/")
:class "inherit"
- (<span :style (css-attrib :color "black") "mopoko") ".com" ))
+ (<span :style (css-attrib :color "black") "mopoko") ".com prerelease" ))
(output-object-to-ml (webapp-frame))))
:page-head (lambda(title)
`(with-ml-output
1  src/packages.lisp
View
@@ -204,6 +204,7 @@
(:nicknames #:tpd2.http)
(:use #:common-lisp #:teepeedee2.lib #:teepeedee2.io)
(:export
+ #:http-serve
#:launch-http-request
#:http-serve-timeout
#:test-http-request
7 src/webapp/channel.lisp
View
@@ -50,9 +50,8 @@
(unquote (channel-state channel)))))
(output-raw-ml (channel-update channel state))))
(output-raw-ml (js-to-string (trigger-fetch-channels))))))
- (if at-least-one
- sendbuf
- (with-ml-output (output-raw-ml "/* nothing ready to send */"))))))
+ (when at-least-one
+ sendbuf))))
(defun channel-respond (con done &key .channels.)
(let ((channel-states (channel-string-to-states .channels.)))
@@ -63,7 +62,7 @@
(with-specials-restored
(with-frame-site
(awhen (channel-respond-body channel-states)
- (respond-http con done :body it)
+ (respond-http con done :headers +http-header-html-content-type+ :body it)
t)))))
(unless (finished)
(let (func)
3  src/webapp/html-constants.lisp
View
@@ -12,3 +12,6 @@
(defconstant-string +html-class-scroll-to-bottom+ "-scroll-to-bottom-")
(defconstant-string +html-class-collapsed+ "-collapsed-")
+(alexandria:define-constant +http-header-html-content-type+
+ (byte-vector-cat "Content-Type: text/html;charset=utf-8" tpd2.io:+newline+)
+ :test 'equalp)
2  src/webapp/webapp.lisp
View
@@ -36,7 +36,7 @@
(current-site-call page-body-start ,title-ml)
,@body
(current-site-call page-body-footer ,title-ml)))))
- (byte-vector-cat "Content-Type: text/html;charset=utf-8" tpd2.io:+newline+))))))
+ +http-header-html-content-type+)))))
(defmacro webapp-lambda (title-and-options &body body)
(with-unique-names (l)
Please sign in to comment.
Something went wrong with that request. Please try again.