[racket] Racket Web Server

From: Jeremy Kun (kun.jeremy at gmail.com)
Date: Mon Sep 5 21:06:07 EDT 2011

Hi there,

I used the Racket web server a few years ago, and returning to it now I'm
having trouble getting it set up on my home computer (Win Vista, DrRacket
version 5.1.3).

So I went to Continue: Web Applications in
Racket<http://web.mit.edu/drracket_v501/share/racket/doc/continue/index.html>
to
do the hello world program, which I will later practice deploying on a real
web server.

Unfortunately the hello world program from the above link doesn't work on my
machine. First, I press Run in Dr. Racket, and the web page pops up with a
"Could not connect" message, which I eventually found out was because
"localhost" wasn't bound to 127.0.0.1 on my machine. Go figure. After
replacing localhost with 127.0.0.1, I get an error with the following stack
trace:

Servlet (@ /servlets/standalone.rkt) exception:
start: self-contract violation, expected <can-be-response?>, given: '(html
(head (title "My Blog")) (body (h1 "Under construction")))
  contract from you, blaming you
  contract:
    (-> request? can-be-response?)


The program itself is copy-pasted from the webpage, and compiles without
error. Can anyone give me a clue as to what might have gone wrong? I have no
idea how the contract structure works, so the error message is a bit
baffling.

On another note, I tried running the servlet in multiple browsers (hoping
that something as silly as that wasn't the problem), and I noticed that in
IE7 the css for the error message is a bit off. If the Racket devs care
about that sort of thing (I sure don't, but who knows?) then they might want
to fix that. I've attached a screenshot of the error in IE7 here.

I appreciate any words of wisdom to help me get this server running, and I'm
certainly willing to learn something new to fix it.

Regards,
Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20110905/b563f60d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bad-css.jpg
Type: image/jpeg
Size: 115920 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20110905/b563f60d/attachment.jpg>

Posted on the users mailing list.