Skip to content

chore: add table of contents for guide.md #1267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@

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.

## Table of Contents

- [Writing Middleware](#writing-middleware)
- [Middleware Best Practices](#middleware-best-practices)
- [Middleware options](#middleware-options)
- [Named middleware](#named-middleware)
- [Combining multiple middleware with koa-compose](#combining-multiple-middleware-with-koa-compose)
- [Response Middleware](#response-middleware)
- [Async operations](#async-operations)
- [Debugging Koa](#debugging-koa)

## Writing Middleware

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



### Response Middleware

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