Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 60 lines (37 sloc) 1.333 kb
3079ba5 John Fremlin add a quickstart installer script
authored
1 (in-package #:cl-user)
2
3 ;;; First ASDF install the dependencies
4
5 (eval-when (:compile-toplevel :execute :load-toplevel)
6 (require 'asdf-install))
7
3c091c7 John Fremlin better quickstart
authored
8
9 ;;; WARNING -- SIGNATURES NOT CHECKED!
c41e14e John Fremlin update quickstart to print a helpful message and not download packages
authored
10
11 (let ((pkgs
12 (remove-if (lambda (p) (asdf:find-system p nil))
13 '(iterate cffi cl-irregsexp trivial-backtrace parenscript))))
14 (handler-bind (((or asdf-install::key-not-found asdf-install::download-error asdf-install::no-signature)
15 (lambda(c) (declare (ignore c)) (invoke-restart 'asdf-install::skip-gpg-check))))
16 (when pkgs
17 (apply 'asdf-install:install pkgs))))
3079ba5 John Fremlin add a quickstart installer script
authored
18
19 ;;; Load tpd2
20
21 (eval-when (:compile-toplevel :load-toplevel :execute)
22 (handler-bind ((error (lambda(c) (declare (ignore c)) (invoke-restart 'CONTINUE))))
23 (asdf:oos 'asdf:load-op 'teepeedee2)))
24
3c091c7 John Fremlin better quickstart
authored
25 (defpackage #:teepeedee2.quickstart
26 (:use #:cl #:tpd2 #:tpd2.ml.html))
27
28 (in-package #:teepeedee2.quickstart)
29
3079ba5 John Fremlin add a quickstart installer script
authored
30 ;;; Define a /hello page
31
c41e14e John Fremlin update quickstart to print a helpful message and not download packages
authored
32 (defsite *hello*)
33 (with-site (*hello*)
34 (defpage "/hello" (name) :create-frame nil
35 (<h1 "Hello " name)))
3079ba5 John Fremlin add a quickstart installer script
authored
36
37 ;;; Start tpd2 listening
38
3c091c7 John Fremlin better quickstart
authored
39 (http-start-server 8080)
3079ba5 John Fremlin add a quickstart installer script
authored
40
72b5e7d John Fremlin improve quickstart to actually start the event loop
authored
41 ;;; Enter the event-loop
42
c41e14e John Fremlin update quickstart to print a helpful message and not download packages
authored
43 (format t "
44
45
46 Finished everything.
47
48 Launching server!
49
50 Please visit http://localhost:8080/hello?name=New+TPD2er
51 ")
52
3c091c7 John Fremlin better quickstart
authored
53 #+sbcl
54 (sb-thread:make-thread #'event-loop :name "tpd2")
55 #-sbcl
56 (event-loop)
72b5e7d John Fremlin improve quickstart to actually start the event loop
authored
57
3079ba5 John Fremlin add a quickstart installer script
authored
58 ;;; Visit http://localhost:8080/hello
3c091c7 John Fremlin better quickstart
authored
59
Something went wrong with that request. Please try again.