egg-web

0.4.1 • Public • Published

egg-web

Install

$ npm i egg-web --save
$ docker pull hbrls/builder:egg-web-0-3

Usage

// config/plugin.js
exports.web = {
  enable: true,
  package: 'egg-web',
};

Logentries

// app.js
const LogentriesTransport = require('egg-web/transports/logentries.js');

module.exports = app => {
  app.getLogger('logger').set('logentries', new LogentriesTransport({ level: 'INFO', app }));
  app.getLogger('errorLogger').set('logentries', new LogentriesTransport({ level: 'ERROR', app }));
};

Build-In

  1. HttpIn logging

Forward

详见 router.js

router.all('/free-api/:service/:wildcard+', forward({ service }) => service, ({ wildcard }) => `/api/${wildcard}`));

CHANGELOG

0.4.0 (2021-02-08)

  1. 开始向 midway 转型,基本框架没有变动,但暂时不保证完全兼容

MIT License

Readme

Keywords

Package Sidebar

Install

npm i egg-web

Weekly Downloads

4

Version

0.4.1

License

MIT

Unpacked Size

27.2 kB

Total Files

27

Last publish

Collaborators

  • hbrls