1Plack::MIME(3) User Contributed Perl Documentation Plack::MIME(3)
2
3
4
6 Plack::MIME - MIME type registry
7
9 use Plack::MIME;
10
11 my $mime = Plack::MIME->mime_type(".png"); # image/png
12
13 # register new type(s)
14 Plack::MIME->add_type(".foo" => "application/x-foo");
15
16 # Use MIME::Types as a fallback
17 use MIME::Types 'by_suffix';
18 Plack::MIME->set_fallback(sub { (by_suffix $_[0])[0] });
19
21 Plack::MIME is a simple MIME type registry for Plack applications. The
22 selection of MIME types is based on Rack's Rack::Mime module.
23
25 Rack::Mime <https://github.com/rack/rack/blob/master/lib/rack/mime.rb>
26 MIME::Types
27
28
29
30perl v5.34.0 2021-07-22 Plack::MIME(3)