Skip to content

koa-modules/koa-redirects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM version Build status Test coverage License Dependency status

koa-redirects

  • redirect with prefix
  • map support

Example

const redirects = require('koa-redirects')
const koa = require('koa')
const app = koa()

redirects(app, {
  prefix: '/api/v2',
  map: {
    'auth': 'http://some.com/api/oauth'
  }
})

// or
// redirects(app, '/api/v2')

app.use(function*() {
  this.redirects('/bar')
})

app.use(function*() {
  this.redirects('auth')
})

License

MIT

About

[koa-redirects] redirect with prefix for koa

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published