-
#### 正常情况下,对不同的URL调用不同的处理函数,这样才能返回不同的结果。例如像这样写:
```js
app.use(async (ctx, next) => {
if (ctx.request.path === '/') {
ctx.response.body = 'index page';
} else {
await next…
-
`notFound` option does not respect router prefix.
It is called for **any** non-matched path, regardless of the prefix, meaning it can't be used if there are several routers under different prefixes…
-
i `m set a regexp to router.use(), got a error:
> Error: `(.*)`: `middleware` must be a function, not `object`
> at Layer. (...\node_modules\koa-router\lib\layer.js:38:13)
> at Array.forEach…
-
Hi,
Thank you for your contributions! I'd like to hazard suggesting a breaking change: replace **await-busboy** with **async-busboy**.
What I like about **async-busboy** is that the interface is cl…
-
Here's what Koa says:
koa deprecated Support for generators will be removed in v3. See the documentation for examples of how to convert old middleware https://github.com/koajs/koa/blob/master/docs/…
-
## DESC
### ENV
OS Platform:windows 11
Node.js Version: Node.js 16
ThinkJS Version: 3.2.13
### code
```js
// your code here
```
### error message
```
// your error message h…
-
Hey,
Thanks for this awesome package! I find myself enabling Koa middleware based on a request condition a lot and `koa-if` would make it a breeze. But the lack of support for `koa@1` makes it impos…
-
For example, Exercise 1 still tells you to use `app = koa()` instead of the class-based notation (`app = new Koa()`).
And once you change this, koa tells you that generators are now deprecated and wi…
-
Hi there. Thanks for this library! We've been using it and it's helpful.
I recently ran into an issue unrelated to Apollo, but related to the Koa body-parsing middleware this library expects and re…
-
I have this test:
```
import Koa from 'koa';
import Router from 'koa-router';
import http from 'http';
import request from 'supertest-as-promised';
import adminRoutes from '../../../routes/Adm…