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
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+1"
You can install packages from the command line:
with pub:
$ pub get
Alternatively, your editor might support pub 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 |
|
|
This package version is not analyzed, because it is more than two years old. Check the latest stable version for its analysis.