Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 413 Bytes

README.md

File metadata and controls

14 lines (12 loc) · 413 Bytes

koa-redirects-path

koa-redirects-path middleware

support options { redirects, onRedirect }

redirect support path example:

    redirects = [
        { source: '/pageA', destination: '/pageB', permanent: false },
        { source: '/pageA/:page', destination: '/pageB/:page', permanent: false },
    ]

"permanent" is true then statusCode is 302 else 301 "onRedirect" is a async callback before redirect