-
`koa-router` version: 7.4.0
`koa` version: 2.7.0
#### Code sample:
```js
const router = new Router();
const AppRoutes = [
{
path: '/',
method: 'get',
a…
-
Add the popular cors module to your koa setup, or add a middleware changing the headers
```
use( async ( ctx, next ) => {
ctx.set( 'Access-Control-Allow-Origin', '*' )
await next()
} )
…
-
Hello!
I have one server which should serve several domains (nginx proxy passes), therefore, I need to use like that:
```
router.get('domain1.com/main', ...)
router.get('domain2.com/main', .…
iztsv updated
6 years ago
-
node.js version: v10.16.3
npm/yarn and version: 6.13.4
`@koa/router` version: 8.0.5
`koa` version: 2.11.0
#### Code sample:
```js
const Router = require('@koa/router')
const v…
-
## TypeDI was not able to inject sercie container in controller
Here is my code
i've tried all method written in documentation but still get error
![image](https://github.com/typestack/routing…
-
When using a Koa app as an express middleware, with a path prefix, the `ctx.originalUrl` will not be valid and will not contain the path prefix:
```js
const expressApp = express()
const koaApp = …
-
Request `http://127.0.0.1:8080/random`
Response `Internal Server Error`
Error log:
```js
xxx GET /random 500 354ms -
TypeError: Cannot read property 'length' of undefined
at Object.get…
-
## Idea:
Loading routes pragmatically can get complex. Express router lets you load routes via JavaScript objects. I didn't see if it was possible to do this with Koa-router, is it?
## Use cases:
…
-
#### This issue pertains to the following package(s):
- [ ] GraphQL Playground - Electron App
- [ ] GraphQL Playground HTML
- [ ] GraphQL Playground
- [x] GraphQL Playground Express Middleware
…
-
一直希望实现一个POST请求流,目前测试以下方法可行。
实现原理:拿到请求所有数据后,再封装请求发出
#### 发起请求
POST: localhost:3001/post
#### 转发请求
```
var http = require('http');
// 创建http服务
var app = http.createServer(function (req, re…
onvno updated
5 years ago