Skip to content

longmore/egg-proxy-middleware-new

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

egg-proxy-middleware

proxy plugin for egg.

Can I do for you

This is a plugin for egg. Help you to redriect request from browser to other server api wher CORS.

Install

$ npm i @ac/egg-proxy-middleware --save

Usage

// config/config.${env}.js

// require
exports.middleware = [
    'eggProxy'
];
// config
exports.eggProxy = {
    rules: [
        {
            proxy_location: '/login.aspx', // redirect url
            proxy_pass: 'http://m.acfun.cn', // target origin
        }
    ],
    body_parse: true,
    proxy_timeout: 3000,
    gzip: true // default value is true
};
// app/middleware/egg_proxy.js

// wrapper
module.exports = require('@ac/egg-proxy-middleware');

Support

framework: koa2

request method: get/post/put/delete

request data format: url/form/multipart

Questions & Suggestions

Please open an issue here.

License

MIT

About

eggjs代理中间件

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published