Browse files

updated: Added redirect.

  • Loading branch information...
1 parent 02b6261 commit d64340dc16ced16dbf51bf4229fea279c8d09d01 @gf3 gf3 committed Aug 3, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 app.rkt
7 app.rkt
@@ -10,15 +10,22 @@
(define-values (twatlr-dispatch twatlr-url)
[("") home-page]
+ [("thread") redirect-thread]
[("thread" (string-arg)) view-thread]))
(define (home-page req)
(render home-page-tmpl))
+(define (redirect-thread req)
+ (redirect-to (string-append "/thread/" (cdr (assoc 'tweet (url-query (request-uri req)))))
+ permanently))
(define (view-thread req t)
`(html (head (title "View Thread"))
(body (p "View thread for tweet:")
(p ,t)))))
(define (not-found req)
`(html (head (title "Hello world!"))

0 comments on commit d64340d

Please sign in to comment.