mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Bumps [lints](https://github.com/dart-lang/core/tree/main/pkgs) from 5.1.1 to 6.0.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dart-lang/core/releases">lints's releases</a>.</em></p> <blockquote> <h2>package:lints v6.0.0</h2> <ul> <li><code>core</code>: <ul> <li>added <a href="https://dart.dev/lints/strict_top_level_inference">strict_top_level_inference</a> (<a href="https://redirect.github.com/dart-lang/core/issues/836">dart-lang/core#836</a>)</li> </ul> </li> <li><code>recommended</code>: <ul> <li>added <a href="https://dart.dev/lints/unnecessary_underscores">unnecessary_underscores</a> (<a href="https://redirect.github.com/dart-lang/core/issues/856">dart-lang/core#856</a>)</li> </ul> </li> <li>Require Dart 3.8.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="228112c086"><code>228112c</code></a> prep to publish 6.0.0 of package:lints (<a href="https://github.com/dart-lang/core/tree/main/pkgs/issues/878">#878</a>)</li> <li><a href="e32c7b96b9"><code>e32c7b9</code></a> Fix StreamGroup.broadcast() close() not completing when streams close. (<a href="https://github.com/dart-lang/core/tree/main/pkgs/issues/876">#876</a>)</li> <li><a href="af37fe54c3"><code>af37fe5</code></a> Adds <code>[Heap]PriorityQueue.of</code> constructor. (<a href="https://github.com/dart-lang/core/tree/main/pkgs/issues/734">#734</a>)</li> <li><a href="635dfa32c2"><code>635dfa3</code></a> [collection] explicitly make BoolList abstract interface (<a href="https://github.com/dart-lang/core/tree/main/pkgs/issues/875">#875</a>)</li> <li><a href="a6e81e0b74"><code>a6e81e0</code></a> Make URL strategy better at recognizing URLs. (<a href="https://github.com/dart-lang/core/tree/main/pkgs/issues/873">#873</a>)</li> <li><a href="61e677100b"><code>61e6771</code></a> Check for mandatory when using option (<a href="https://github.com/dart-lang/core/tree/main/pkgs/issues/871">#871</a>)</li> <li><a href="db610bb595"><code>db610bb</code></a> Adjust the implements clause of IntX (<a href="https://github.com/dart-lang/core/tree/main/pkgs/issues/866">#866</a>)</li> <li><a href="22d8879fcb"><code>22d8879</code></a> [package:lints] fix the changelog (<a href="https://github.com/dart-lang/core/tree/main/pkgs/issues/867">#867</a>)</li> <li><a href="9f43210084"><code>9f43210</code></a> add strict_top_level_inference to the core lint set (<a href="https://github.com/dart-lang/core/tree/main/pkgs/issues/864">#864</a>)</li> <li><a href="15c7fe9958"><code>15c7fe9</code></a> add unnecessary_underscores to recommended (<a href="https://github.com/dart-lang/core/tree/main/pkgs/issues/863">#863</a>)</li> <li>Additional commits viewable in <a href="https://github.com/dart-lang/core/commits/lints-v6.0.0/pkgs">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
A server app built using Shelf, configured to enable running with Docker.
This sample code handles HTTP GET requests to / and /echo/<message>
Running the sample
Running with the Dart SDK
You can run the example with the Dart SDK like this:
$ dart run bin/server.dart
Server listening on port 8080
And then from a second terminal:
$ curl http://0.0.0.0:8080
Hello, World!
$ curl http://0.0.0.0:8080/echo/I_love_Dart
I_love_Dart
Running with Docker
If you have Docker Desktop installed, you
can build and run with the docker command:
$ docker build . -t myserver
$ docker run -it -p 8080:8080 myserver
Server listening on port 8080
And then from a second terminal:
$ curl http://0.0.0.0:8080
Hello, World!
$ curl http://0.0.0.0:8080/echo/I_love_Dart
I_love_Dart
You should see the logging printed in the first terminal:
2021-05-06T15:47:04.620417 0:00:00.000158 GET [200] /
2021-05-06T15:47:08.392928 0:00:00.001216 GET [200] /echo/I_love_Dart