yhsd-egg
### Installation ``` npm install yhsd-egg --save ```
Last updated 2 years ago by hjaurum .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install yhsd-egg 
SYNC missed versions from official npm registry.

yhsd-egg

Installation

  npm install yhsd-egg --save

Features

基于egg.js定制,与egg.js不同之处:

中间件
  • 增加cors(跨域)中间件,配置:

      exports.cors = {
      	allowOrigin: 默认 '*'
      	allowHeaders: 默认'Content-Type, Content-Length, Accept, X-Requested-With'
      	allowMethods: 默认'PUT, POST, GET, DELETE, OPTIONS'
      }
    
插件
  • 关闭CSRF防范,避免本地测试时报invalid csrf token错误

  • 增加yhsd-api插件,app.Yhsd可以直接获取yhsd-api, 免去require('yhsd-api'),且其中所有的prototype已经被bluebird promisifyAll,因此支持async。

      const Yhsd = app.Yhsd;
      const api = new Yhsd.Api(options);
      const customer = await api.getAsync(options)
    

Current Tags

  • 1.0.5                                ...           latest (2 years ago)

6 Versions

  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 1
Last Week 3
Last Month 1
Dependencies (3)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |