[plt-scheme] pretty URLs

From: maxigas (maxigas at anargeek.net)
Date: Sun Dec 28 18:21:38 EST 2008

hi!

From: Dave Gurnell <d.j.gurnell at gmail.com>
Subject: Re: [plt-scheme] pretty URLs
Date: Sun, 28 Dec 2008 22:37:42 +0000

>     (serve/servlet start #:launch-browser #f #:port 80 #:servlet-path (string->path "/code.ss"))
>    
>     --->
>    
>     Servlet (@ /servlets/code.ss) didn't load:
>     build-path: absolute path "/code.ss" cannot be added to a path
> 
> The #:servlet-path argument refers to the local URL of the servlet. It should be a string rather than a path object. This is
> different to the #:extra-files-paths and #:mime-types-path arguments, which refer to paths on your local filesystem.

I tried with a simple string before, but then i got a quite clear error message from mzscheme m3
1.1.4, which says at the end that it expected a path for the #:servlet-path keyword (see below)!
I hope this is just a misleading error message or a buggy version, because this behavious doesn't
work on the one hand and contradicts the documentation [1] on the other hand.  1.4.3. has been
compiling on my G3 PPC/Debian for three hours now, so i hope it will finish sooner or later and i
can confirm that it works with it. :) thank you for your example, i learned from it a lot, and
now that i am reading the dispatcher docs i am pretty sure i will try it because it's a very
useful and elegant thing and seems to be exactly what i was looking for! working with Scheme is
like LSD: modify your consciousness for sure and sometimes it's a bad trip. %o

[1] http://docs.plt-scheme.org/web-server/servlet-env_ss.html

(file "/usr/local/plt/lib/plt/collects/web-server/default-web-root/././servlets/code.ss") broke
the contract 
  (->*
   ((-> request? response?))
   (#:extra-files-path
    path?
    #:file-not-found-path
    path?
    #:launch-browser?
    boolean?
    #:listen-ip
    string?
    #:manager
    manager?
    #:mime-types-path
    path?
    #:port
    number?
    #:quit?
    boolean?
    #:server-root-path
    path?
    #:servlet-namespace
    (listof module-path?)
    #:servlet-path
    path?
    #:servlets-root
    path?)
   void)
 on serve/servlet; expected <path?>, given: "/code.ss"



Posted on the users mailing list.