Skip to content

Commit 673591e

Browse files
authored
docs: update dynamic routes in example and README (#47)
1 parent 215c798 commit 673591e

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Future<Response> onRequest(RequestContext context) async {
131131

132132
#### Dynamic Routes 🌓
133133

134-
Dart Frog supports dynamic routes. For example, if you create a file called `routes/posts/<id>.dart`, then it will be accessible at `/posts/1`, `/posts/2`, etc.
134+
Dart Frog supports dynamic routes. For example, if you create a file called `routes/posts/[id].dart`, then it will be accessible at `/posts/1`, `/posts/2`, etc.
135135

136136
Routing parameters are forwarded to the `onRequest` method as seen below.
137137

example/pubspec.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ environment:
77
sdk: ">=2.17.0 <3.0.0"
88

99
dependencies:
10-
dart_frog:
11-
git:
12-
url: https://github.com/VeryGoodOpenSource/dart_frog
13-
path: packages/dart_frog
10+
dart_frog: ^0.0.1-dev
1411

1512
dev_dependencies:
1613
mocktail: ^0.3.0

example/test/routes/echo/<message>_test.dart renamed to example/test/routes/echo/[message]_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'package:dart_frog/dart_frog.dart';
44
import 'package:mocktail/mocktail.dart';
55
import 'package:test/test.dart';
66

7-
import '../../../routes/echo/<message>.dart' as route;
7+
import '../../../routes/echo/[message].dart' as route;
88

99
class _MockRequestContext extends Mock implements RequestContext {}
1010

0 commit comments

Comments
 (0)