Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions main.rkt
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#lang racket/base

(require net/mime-type
(require (for-syntax racket/base)
net/mime-type
net/url
racket/string
racket/cmdline
racket/exn
racket/file
racket/format
racket/match
racket/path
racket/runtime-path
racket/string
raco/command-name
(prefix-in sequencer: web-server/dispatchers/dispatch-sequencer)
(prefix-in static-files: web-server/dispatchers/dispatch-files)
Expand All @@ -20,8 +21,7 @@
web-server/http/response-structs
web-server/http/xexpr
web-server/web-server
version-case
(for-syntax racket/base))
version-case)

(version-case
[(version< (version) "8.6")
Expand Down Expand Up @@ -82,10 +82,10 @@
"g+OxtRr3kD3i34XobUD3R/wAbP4MRlJ8mCBAAAAAElFTkSuQmCC"))

(define root-url
(url #f #f #f #f #t null null #f))
(string->url ""))

(define up-url
(url #f #f #f #f #f (list (path/param 'up null)) null #f))
(string->url ".."))

(define (relative-path-url-to-root p)
(define simple-path (simplify-path p))
Expand Down Expand Up @@ -161,7 +161,7 @@
(list (file->bytes favicon-path)))]
[else (next-dispatcher)])))))

(define (not-found req)
(define (not-found _req)
(response/xexpr
#:code 404
#:message #"Not Found"
Expand Down Expand Up @@ -208,4 +208,3 @@

(with-handlers ([exn:break? void]) (do-not-return))
(shutdown-server))