Add example; bump pedantic
diff --git a/README.md b/README.md index e12c8d1..b06d3f8 100644 --- a/README.md +++ b/README.md
@@ -14,7 +14,7 @@ // server. HttpMultiServer.loopback(8080).then((server) { shelf_io.serveRequests(server, (request) { - return new shelf.Response.ok("Hello, world!"); + return shelf.Response.ok("Hello, world!"); }); }); }
diff --git a/analysis_options.yaml b/analysis_options.yaml index 8dfb3d0..027be6f 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml
@@ -4,8 +4,6 @@ implicit-casts: false linter: rules: - - avoid_empty_else - - avoid_init_to_null - avoid_null_checks_in_equality_operators - avoid_unused_constructor_parameters - annotate_overrides @@ -15,30 +13,18 @@ - constant_identifier_names - control_flow_in_finally - directives_ordering - - empty_catches - - empty_constructor_bodies - empty_statements - hash_and_equals - implementation_imports - iterable_contains_unrelated_type - - library_names - - library_prefixes - list_remove_unrelated_type - non_constant_identifier_names - overridden_fields - package_api_docs - package_names - package_prefixed_library_names - - prefer_equal_for_default_values - prefer_final_fields - prefer_generic_function_type_aliases - - prefer_is_not_empty - - slash_for_doc_comments - test_types_in_equals - throw_in_finally - - type_init_formals - unnecessary_brace_in_string_interps - - unnecessary_const - - unnecessary_new - - unrelated_type_equality_checks - - valid_regexps
diff --git a/example/main.dart b/example/main.dart new file mode 100644 index 0000000..3bc42b0 --- /dev/null +++ b/example/main.dart
@@ -0,0 +1,13 @@ +import 'package:http_multi_server/http_multi_server.dart'; +import 'package:shelf/shelf.dart' as shelf; +import 'package:shelf/shelf_io.dart' as shelf_io; + +void main() { + // Both http://127.0.0.1:8080 and http://[::1]:8080 will be bound to the same + // server. + HttpMultiServer.loopback(8080).then((server) { + shelf_io.serveRequests(server, (request) { + return shelf.Response.ok("Hello, world!"); + }); + }); +}
diff --git a/pubspec.yaml b/pubspec.yaml index 7249a60..52b6f0f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml
@@ -14,5 +14,5 @@ dev_dependencies: http: ^0.12.0 - pedantic: ^1.4.0 + pedantic: ^1.8.0 test: ^1.5.2