shelf_test is a set of Dart 2 compliant sample servers for development of server applications utilizing shelf web server middleware pub package.
This repository consists of following server codes.
-
handler_sample_1.dart : Very simple sample echo server handler. Access this server like: http://localhost:8080/test
-
handler_sample_2.dart : Simple sample handler that dumps out incoming request for proper analysis. This server has prompt page and favicon image handling capability. Access this server from Chrome using : http://localhost:8080/
-
bin/middleware_sample_1.dart : Sample middleware code showing how to hand modified request to the innerHandler. Access this server from Chrome using : http://localhost:8080/test
-
bin/middleware_sample_2.dart : Sample middleware code that returns response directly. Opening with 'http://localhost:8080/middleware' will cause direct return.
-
bin/middleware_sample_3.dart : Sample middleware code showing how to modify the response from the innerHandler. Call this server like 'http://localhost:8080/123'.
このサンプルは「解説Dart 2プログラミング言語」の 添付資料です。詳細は「ミドルウエア・フレームワーク (shelf)」の章をご覧ください。
These samples are attachments to the Dart 2 Language Guide written in Japanese.
- Download this repository, uncompress and rename the folder to shelf_test.
- From IDE, File > Open Folder and select this shelf_test folder.
- Run one of above servers.
- Access the server from your browser following to instructions.
- Tested on Windows.
These samples are licensed under MIT License.