think_http

1.1.6 • Public • Published

介绍


npm version Dependency Status

Ctx extensions for ThinkKoa.

安装


npm i think_http

使用


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

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

config: { //中间件配置
    ...,
    http: {
        cookie: {
            domain: '',  // cookie所在的域名
            path: '/',       // cookie所在的路径
            maxAge: -1, // cookie有效时长
            httpOnly: true,  // 是否只用于http请求中获取
            overwrite: false,  // 是否允许重写
            //expires: new Date('2017-02-15')  // cookie失效时间
        }
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i think_http

Weekly Downloads

3

Version

1.1.6

License

MIT

Last publish

Collaborators

  • richenlin