koa-mount-hostname
0.2.0 • Public • Published koa-mount-hostname
Mount other Koa applications as middleware on a specific hostname (subdomain).
Installation
$ npm install koa-mount-hostname
Example
const mountHostname = require('koa-mount-hostname');
const koa = require('koa');
const a = koa();
a.use(function *(next){
this.body = 'Hello';
});
const b = koa();
b.use(function *(next){
this.body = 'World';
});
const app = koa();
app.use(mountHostname('www.website1.com', a));
app.use(mountHostname(/^[a-z]+\.website2\.com$/i, b));
app.listen(3000);
License
MIT
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 0.2.0
6
Version History
Package Sidebar
Install
Weekly Downloads