Skip to content

Commit fd75d39

Browse files
committed
chore: Update README.md file
1 parent f21d4db commit fd75d39

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

README.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,20 @@ dependencies:
2929
```dart
3030
import 'package:pharaoh/pharaoh.dart';
3131

32-
final app = Pharaoh();
33-
3432
void main() async {
3533

36-
app.use((req, res, next) {
37-
38-
/// do something here
39-
40-
next();
41-
42-
});
43-
44-
app.get('/foo', (req, res) => res.ok("bar"));
45-
46-
final guestRouter = app.router()
34+
final guestRouter = Pharaoh.router
4735
..get('/user', (req, res) => res.ok("Hello World"))
4836
..post('/post', (req, res) => res.json({"mee": "moo"}))
4937
..put('/put', (req, res) => res.json({"pookey": "reyrey"}));
5038

51-
app.group('/guest', guestRouter);
39+
final app = Pharaoh()
40+
..use((req, res, next) => next());
41+
..get('/foo', (req, res) => res.ok("bar"))
42+
..group('/guest', guestRouter);
5243

53-
await app.listen(); // port => 3000
44+
await app.listen();
5445
}
55-
5646
```
5747

5848
See the [Pharaoh Examples](./pharaoh_examples/lib/) directory for more practical use-cases.

0 commit comments

Comments
 (0)