Updated shelf

This commit is contained in:
Thomas Hii 2024-06-23 17:45:28 +08:00
parent 9b164c8740
commit d31a07bbab
3 changed files with 7 additions and 6 deletions

View file

@ -1,6 +1,6 @@
# Change Log # Change Log
## 8.0.0 ## 8.0.0-beta.1
* Require Dart >= 3.3 * Require Dart >= 3.3
* Updated `lints` to 4.0.0 * Updated `lints` to 4.0.0

View file

@ -1,5 +1,5 @@
name: angel3_shelf name: angel3_shelf
version: 8.0.0 version: 8.0.0-beta.1
description: Shelf interop with Angel3. Use this to wrap existing server code. description: Shelf interop with Angel3. Use this to wrap existing server code.
homepage: https://angel3-framework.web.app/ homepage: https://angel3-framework.web.app/
repository: https://github.com/dart-backend/angel/tree/master/packages/shelf repository: https://github.com/dart-backend/angel/tree/master/packages/shelf
@ -7,9 +7,9 @@ environment:
sdk: '>=3.3.0 <4.0.0' sdk: '>=3.3.0 <4.0.0'
publish_to: none publish_to: none
dependencies: dependencies:
angel3_framework: ^8.0.0 angel3_framework: ^8.4.0
angel3_container: ^8.0.0 angel3_container: ^8.2.0
angel3_mock_request: ^8.0.0 angel3_mock_request: ^8.2.0
path: ^1.9.0 path: ^1.9.0
shelf: ^1.3.0 shelf: ^1.3.0
stream_channel: ^2.1.0 stream_channel: ^2.1.0

View file

@ -1,5 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:angel3_container/mirrors.dart';
import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_framework/http.dart'; import 'package:angel3_framework/http.dart';
import 'package:angel3_shelf/angel3_shelf.dart'; import 'package:angel3_shelf/angel3_shelf.dart';
@ -51,7 +52,7 @@ void main() {
}); });
var logger = Logger.detached('angel3_shelf')..onRecord.listen(prettyLog); var logger = Logger.detached('angel3_shelf')..onRecord.listen(prettyLog);
var app = Angel(logger: logger); var app = Angel(logger: logger, reflector: MirrorsReflector());
var httpDriver = AngelHttp(app); var httpDriver = AngelHttp(app);
app.get('/angel', (req, res) => 'Angel'); app.get('/angel', (req, res) => 'Angel');
app.fallback(embedShelf(handler, throwOnNullResponse: true)); app.fallback(embedShelf(handler, throwOnNullResponse: true));