egg-http-proxy-middleware
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

egg-http-proxy-middleware

http-proxy-middleware for egg

NPM version NPM downloads dependency Status dependency Status code style: prettier

Use

npm i egg-http-proxy-middleware --save

Register

// {app_root}/app/middleware/proxy.js
'use strict';

module.exports = require('egg-http-proxy-middleware');
// {app_root}/config/config.default.js
config.middleware = ['proxy'];

Config

// {app_root}/config/config.default.js
proxy: {
    '/api': {
        target: 'http://github.com/daysai',
        changeOrigin: true,
        secure: false,
        pathRewrite: { '^/api': '' },
    },
}

/egg-http-proxy-middleware/

    Package Sidebar

    Install

    npm i egg-http-proxy-middleware

    Weekly Downloads

    18

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    9.52 kB

    Total Files

    6

    Last publish

    Collaborators

    • lip966