shelf_static
is a Handler
for the Dart shelf
package.
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);
}
http_parser
3.0.0.shelf
0.7.0.http_parser
2.0.0.http_parser
1.0.0.listDirectories
argument to createStaticHandler
. Bumped up minimum SDK to 1.7.0.
Added support for shelf
0.6.0.
Uri
format checks now that the core libraries is more strict. Removed deprecated getHandler
.
Send correct mime type for default document.
DateTime
and HTTP date format.shelf
. Cleaned up test code by using new features.defaultDocument
argument to createStaticHandler
.createStaticHandler
added serveFilesOutsidePath
optional parameter.createStaticHandler
. getHandler
is deprecated.content-type
header if the mime type of the requested file can be determined from the file extension.304-Not modified
against IF-MODIFIED-SINCE
request header.fileSystemPath
.example/example_server.dart
.last-modified
header.Add this to your package's pubspec.yaml file:
dependencies:
shelf_static: "^0.2.3+4"
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.
Now in your Dart code, you can use:
import 'package:shelf_static/shelf_static.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
0.2.7 | Jan 4, 2018 |
|
|
0.2.6 | Oct 18, 2017 |
|
|
0.2.5 | Jul 7, 2017 |
|
|
0.2.4 | Jul 6, 2016 |
|
|
0.2.3+4 | May 5, 2016 |
|
|
0.2.3+3 | Feb 2, 2016 |
|
|
0.2.3+2 | Dec 14, 2015 |
|
|
0.2.3+1 | Aug 26, 2015 |
|
|
0.2.3 | Jul 31, 2015 |
|
|
0.2.2 | Mar 6, 2015 |
|
|
We analyzed this package on Apr 9, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
92 | / 100 |
Health:
Code health derived from static analysis.
[more]
|
99 | / 100 |
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
7 | / 100 |
Overall score:
Weighted score of the above.
[more]
|
77 |
Detected platforms: Flutter, other
Primary library:
package:shelf_static/shelf_static.dart
with components:io
,isolate
.
The description is too short.
Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.
Package is pre-v1 release.
While there is nothing inherently wrong with versions of
0.*.*
, it usually means that the author is still experimenting with the general direction API.
Fix analysis and formatting issues.
Analysis or formatting checks reported 2 hints.
Run
dartfmt
to formatlib/src/directory_listing.dart
.Run
dartfmt
to formatlib/src/static_handler.dart
.
Maintain an example.
None of the files in your
example/
directory matches a known example patterns. Common file name patterns include:main.dart
,example.dart
or you could also useshelf_static.dart
.
Use analysis_options.yaml
.
Rename old
.analysis_options
file toanalysis_options.yaml
.
Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=1.7.0 <2.0.0 | ||
http_parser | >=0.0.2+2 <4.0.0 | 3.1.1 | |
mime | >=0.9.0 <0.10.0 | 0.9.6 | |
path | >=1.1.0 <2.0.0 | 1.5.1 | |
shelf | >=0.5.7 <0.8.0 | 0.7.2 | |
Transitive dependencies | |||
async | 2.0.6 | ||
charcode | 1.1.1 | ||
collection | 1.14.9 | ||
source_span | 1.4.0 | ||
stack_trace | 1.9.2 | ||
stream_channel | 1.6.4 | ||
string_scanner | 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 |