mirror of
https://github.com/cupcakearmy/koa-parser.git
synced 2024-12-22 08:06:30 +00:00
Changed to cca-koa-router
This commit is contained in:
parent
e70398f9c1
commit
cc06fc22fd
10
README.md
10
README.md
@ -9,18 +9,18 @@ Koa-Middleware for parsing body parameters in the request. Lightweight and no de
|
|||||||
```javascript
|
```javascript
|
||||||
const
|
const
|
||||||
Koa = require('koa'),
|
Koa = require('koa'),
|
||||||
router = require('koa-simple-router'),
|
parser = require('cca-koa-parser'),
|
||||||
parser = require('cca-koa-parser')
|
router = require('cca-koa-router')
|
||||||
|
|
||||||
const
|
const
|
||||||
app = new Koa(),
|
app = new Koa(),
|
||||||
port = 3001
|
port = 3000
|
||||||
|
|
||||||
app.use(parser)
|
app.use(parser)
|
||||||
|
|
||||||
app.use(router({}, _ => {
|
app.use(router(_ => {
|
||||||
_.post('/', (c, n) => {
|
_.post('/', (c, n) => {
|
||||||
c.body = [200, c.request.body]
|
c.body = c.request.body
|
||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cca-koa-parser",
|
"name": "cca-koa-parser",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "Koa Body Parser",
|
"description": "Koa Body Parser",
|
||||||
"main": "Parser.js",
|
"main": "Parser.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
Loading…
Reference in New Issue
Block a user