Page 1 of 1

First Hunchentoot "Hello World!" page not found

Posted: Sat Sep 15, 2012 3:33 pm
by cos
New to Lisp.
Setup is Linux & SBCL.
Hunchentoot installed and runs with NginX in front of it.
I can run and access the Hunchentoot test site.

Now I'm trying to create pages. Complex ones did not work, so I'm down to the simplest page I can find as an example:

Code: Select all

(ql:quickload "hunchentoot")
(use-package :hunchentoot)

(start (make-instance 'acceptor :port 8080))

(define-easy-handler (greet :uri "/hello") (name)
  (format nil "<html><body><h1>Hello ~a!</h1></body></html>" name))
I have saved it as page.lisp.
With Hunchentoot off, I can:

Code: Select all

(load "/home/cos/page.lisp")
and it starts Hunchentoot.
When I point my browser to 127.0.0.1:8080/hello, I get "Resource /hello not found." with the cute lizard, so I know my error page is being served up by Hunchentoot. But where's my "Hello!" page?

OK, what super-basic thing am I missing here?

Many thanks,
COS

Re: First Hunchentoot "Hello World!" page not found

Posted: Sat Sep 15, 2012 4:58 pm
by cos
And the answer is add "easy":

Code: Select all

(start (make-instance 'easy-acceptor :port 8080))
Thanks,
COS