Commit 2cde267
docs: Add documentation for basic routing, requests and responses (#223)
## Description
This PR adds comprehensive documentation and examples for Relic's core
concepts, including:
- **Basic Routing Documentation**: Added complete guide
(`03-basic-routing.md`) covering route definition, HTTP methods,
handlers, and pipeline composition with working examples
- **Requests Documentation**: Added comprehensive guide
(`04-requests.md`) covering request properties, query parameters,
type-safe headers, body parsing, and validation best practices
- **Responses Documentation**: Added detailed guide (`05-responses.md`)
covering response creation, status codes, headers, body types, and error
handling patterns
- **Enhanced Code Documentation**: Added extensive inline documentation
to core classes including `Body`, `Request`, `Response`, `Headers`,
`Router`, `Handler`, `Pipeline`, and `Middleware`
### Code Examples
- **Basic Routing Example**: Created focused `basic_routing.dart`
demonstrating fundamental HTTP routing patterns
- **Comprehensive Example**: Completely refactored
`requets_response_example.dart` with all documentation examples in a
runnable format
- **Cross-Referenced Examples**: All documentation examples are
validated and present in the example files
- **Inline Documentation**: Updated core library classes with practical
examples and usage patterns
## Related Issues
- Closes: ?
## Pre-Launch Checklist
Please ensure that your PR meets the following requirements before
submitting:
- [x] This update focuses on a single feature or bug fix. (For multiple
fixes, please submit separate PRs.)
- [x] I have read and followed the [Dart Style
Guide](https://dart.dev/guides/language/effective-dart/style) and
formatted the code using [dart
format](https://dart.dev/tools/dart-format).
- [ ] I have referenced at least one issue this PR fixes or is related
to.
- [x] I have updated/added relevant documentation (doc comments with
`///`), ensuring consistency with existing project documentation.
- [x] I have added new tests to verify the changes.
- [x] All existing and new tests pass successfully.
- [x] I have documented any breaking changes below.
## Breaking Changes
- [x] No breaking changes.
---------
Co-authored-by: Kasper Overgård Nielsen <[email protected]>1 parent e58c951 commit 2cde267
File tree
17 files changed
+1821
-320
lines changed- doc
- site/docs/02-core-concepts
- example
- lib/src
- body
- handler
- headers
- message
- middleware
- router
17 files changed
+1821
-320
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
0 commit comments