shelf_static 0.2.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 75

shelf_static is a Handler for the Dart shelf package.

Build Status Coverage Status

Example

import 'package:shelf/shelf_io.dart' as io;
import 'package:shelf_static/shelf_static.dart';

void main() {
  var handler = createStaticHandler('example/files', 
      defaultDocument: 'index.html');

  io.serve(handler, 'localhost', 8080);
}

0.2.3

  • Added listDirectories argument to createStaticHandler.

0.2.2

  • Bumped up minimum SDK to 1.7.0.

  • Added support for shelf 0.6.0.

0.2.1

  • Removed Uri format checks now that the core libraries is more strict.

0.2.0

  • Removed deprecated getHandler.

  • Send correct mime type for default document.

0.1.4+6

  • Updated development dependencies.

0.1.4+5

  • Handle differences in resolution between DateTime and HTTP date format.

0.1.4+4

  • Using latest shelf. Cleaned up test code by using new features.

0.1.4

  • Added named (optional) defaultDocument argument to createStaticHandler.

0.1.3

  • createStaticHandler added serveFilesOutsidePath optional parameter.

0.1.2

  • The preferred top-level method is now createStaticHandler. getHandler is deprecated.
  • Set content-type header if the mime type of the requested file can be determined from the file extension.
  • Respond with 304-Not modified against IF-MODIFIED-SINCE request header.
  • Better error when provided a non-existant fileSystemPath.
  • Added example/example_server.dart.

0.1.1+1

  • Removed work around for issue.

0.1.1

  • Correctly handle requests when not hosted at the root of a site.
  • Send last-modified header.
  • Work around known issue with HTTP date formatting.

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  shelf_static: "^0.2.3"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:shelf_static/shelf_static.dart';
        
Version Uploaded Documentation Archive
0.2.6 Oct 18, 2017 Go to the documentation of shelf_static 0.2.6 Download shelf_static 0.2.6 archive
0.2.5 Jul 7, 2017 Go to the documentation of shelf_static 0.2.5 Download shelf_static 0.2.5 archive
0.2.4 Jul 6, 2016 Go to the documentation of shelf_static 0.2.4 Download shelf_static 0.2.4 archive
0.2.3+4 May 5, 2016 Go to the documentation of shelf_static 0.2.3+4 Download shelf_static 0.2.3+4 archive
0.2.3+3 Feb 2, 2016 Go to the documentation of shelf_static 0.2.3+3 Download shelf_static 0.2.3+3 archive
0.2.3+2 Dec 14, 2015 Go to the documentation of shelf_static 0.2.3+2 Download shelf_static 0.2.3+2 archive
0.2.3+1 Aug 26, 2015 Go to the documentation of shelf_static 0.2.3+1 Download shelf_static 0.2.3+1 archive
0.2.3 Jul 31, 2015 Go to the documentation of shelf_static 0.2.3 Download shelf_static 0.2.3 archive
0.2.2 Mar 6, 2015 Go to the documentation of shelf_static 0.2.2 Download shelf_static 0.2.2 archive
0.2.1 Sep 23, 2014 Go to the documentation of shelf_static 0.2.1 Download shelf_static 0.2.1 archive

All 24 versions...

Analysis

This feature is new.
We welcome feedback.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Dec 7, 2017
  • Dart: 2.0.0-dev.8.0
  • pana: 0.7.3+1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
90
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall score:
Weighted score of the above. [more]
75

Platforms

Detected platforms: Flutter, server

all of the above

Dependencies

Package Constraint Resolved Available
Direct dependencies
http_parser >=0.0.2+2 <0.1.0 0.0.2+8 3.1.1
mime >=0.9.0 <0.10.0 0.9.4
path >=1.1.0 <2.0.0 1.5.1
shelf >=0.5.7 <0.7.0 0.6.3 0.7.1
Transitive dependencies
charcode 1.1.1
collection 1.14.3
convert 1.1.1 2.0.1
crypto 0.9.2+1 2.0.2+1
source_span 1.4.0
stack_trace 1.9.1
string_scanner 0.1.5 1.0.2
typed_data 1.1.5
Dev dependencies
args >=0.12.0 <0.14.0
scheduled_test >=0.12.0 <0.13.0
test >=0.12.0 <0.13.0