Skip to content

友好速搭插件开发egg.js🥚扩展框架——yhsd-egg🥚!

Notifications You must be signed in to change notification settings

yeezon/yhsd-egg

Repository files navigation

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)
    

About

友好速搭插件开发egg.js🥚扩展框架——yhsd-egg🥚!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published