Wondering what’s next for npm?Check out our public roadmap! »

    egg-web

    0.4.0 • 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

    Install

    npm i egg-web

    DownloadsWeekly Downloads

    4

    Version

    0.4.0

    License

    MIT

    Unpacked Size

    27.1 kB

    Total Files

    27

    Last publish

    Collaborators

    • avatar