Skip to content

Commit 325792a

Browse files
ZYSzysdead-horse
authored andcommitted
docs: add table of contents for guide.md (#1267)
1 parent 9905199 commit 325792a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

docs/guide.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33

44
This guide covers Koa topics that are not directly API related, such as best practices for writing middleware and application structure suggestions. In these examples we use async functions as middleware - you can also use commonFunction or generatorFunction which will be a little different.
55

6+
## Table of Contents
7+
8+
- [Writing Middleware](#writing-middleware)
9+
- [Middleware Best Practices](#middleware-best-practices)
10+
- [Middleware options](#middleware-options)
11+
- [Named middleware](#named-middleware)
12+
- [Combining multiple middleware with koa-compose](#combining-multiple-middleware-with-koa-compose)
13+
- [Response Middleware](#response-middleware)
14+
- [Async operations](#async-operations)
15+
- [Debugging Koa](#debugging-koa)
16+
617
## Writing Middleware
718

819
Koa middleware are simple functions which return a `MiddlewareFunction` with signature (ctx, next). When
@@ -123,8 +134,6 @@ const all = compose([random, backwards, pi]);
123134
app.use(all);
124135
```
125136

126-
127-
128137
### Response Middleware
129138

130139
Middleware that decide to respond to a request and wish to bypass downstream middleware may

0 commit comments

Comments
 (0)