Commits

Richo Healey  committed 32d5f89

Use user route handler as wildcard

  • Participants
  • Parent commits 950d65a

Comments (0)

Files changed (2)

File lib/user.scm

+(define user-from-path
+  (lambda (path)
+    (substring path 1 (string-length path))))
+
+(define get-user-page
+  (lambda (user response)
+    (set-response-body
+      (string-append "Hello " user)
+      response)))
 ; (require-extension intarweb)
 (require "lib/response")
 (require "lib/request")
+(require "lib/user")
 
 
 (define ident-so-port
             ((string=? request-path "/rawr")
              (set-response-body "got rawr?" response))
             (else
-             (set-response-body "No such page mang" response))
+             (get-user-page (user-from-path request-path) response))
             )
         out)))
       (close-input-port in)