First Hunchentoot "Hello World!" page not found

Discussion of Common Lisp

First Hunchentoot "Hello World!" page not found

Postby cos » Sat Sep 15, 2012 3:33 pm

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
cos
 
Posts: 3
Joined: Mon Aug 20, 2012 3:11 pm

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

Postby cos » Sat Sep 15, 2012 4:58 pm

And the answer is add "easy":
Code: Select all
(start (make-instance 'easy-acceptor :port 8080))


Thanks,
COS
cos
 
Posts: 3
Joined: Mon Aug 20, 2012 3:11 pm


Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 4 guests