Add MIME types file from Apache to correctly serve files.

This commit is contained in:
Feufochmar 2020-02-02 18:56:06 +01:00
parent 58e746e777
commit 5670d0ed4d
2 changed files with 1864 additions and 3 deletions

1855
mime.types Normal file

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@
web-server/managers/none
web-server/http/redirect
web-server/http/request-structs
web-server/private/mime-types
"../collection/tree.rkt"
"weblet-parameter.rkt"
"website.rkt"
@ -202,9 +203,14 @@
(serve
#:dispatch
(sequencer:make
(files:make #:url->path (make-url->path (string->path (webcontainer-static wcontainer)))) ; File dispatcher, search in the static directory for files
(servlet:make (webcontainer-dispatcher wcontainer)) ; Servlet dispatcher
(servlet:make (webcontainer-not-found-dispatcher wcontainer)) ; 404 error servlet
; File dispatcher, search in the static directory for files
(files:make
#:url->path (make-url->path (string->path (webcontainer-static wcontainer)))
#:path->mime-type (make-path->mime-type "./mime.types"))
; Servlet dispatcher
(servlet:make (webcontainer-dispatcher wcontainer))
; 404 error servlet
(servlet:make (webcontainer-not-found-dispatcher wcontainer))
)
#:port (webcontainer-server-port wcontainer)
#:listen-ip (webcontainer-server-address wcontainer))