3.1.0 • Published 4 years ago

think_payload v3.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

介绍


npm version

Payload parser for ThinkKoa

安装


npm i think_payload

使用


1、payload中间件为thinkkoa内置中间件,无需在项目中创建引用。该中间件默认开启

2、项目中间件配置 config/middleware.js:

config: { //中间件配置
    ...,
    payload: {
        extTypes: {
            json: ['application/json'],
            form: ['application/x-www-form-urlencoded'],
            text: ['text/plain'],
            multipart: ['multipart/form-data'],
            xml: ['text/xml']
        }
        limit: '20mb',
        encoding: 'utf-8',
        //Sets the directory for placing file uploads in. You can move them later on using fs.rename(). The default is os.tmpdir().
        // uploadDir:  os.tmpdir(),
        //If you want checksums calculated for incoming files, set this to either 'sha1' or 'md5'.
        // hash: 'md5'
    }
}
3.1.0

4 years ago

3.0.0

4 years ago

2.3.0

4 years ago

2.2.1

4 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.0

6 years ago

1.2.0

6 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago