在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:wyntau/koa-vhost开源软件地址:https://github.com/wyntau/koa-vhost开源编程语言:JavaScript 100.0%开源软件介绍:koa-vhostvhost for koajs Install
Usagevar koa = require('koa');
var vhost = require('koa-vhost');
var server = koa();
var server1 = koa();
var server2 = koa();
var server3 = koa();
var server4 = koa();
var server5 = koa();
server1.use(function *(next) {
this.body = 'server1';
});
server2.use(function *(next) {
this.body = 'server2';
});
server3.use(function *(next) {
this.body = 'server3';
});
server4.use(function *(next) {
this.body = 'server4';
});
server5.use(function *(next) {
this.body = 'server5';
});
server.use(vhost('s1.example.com', server1));
server.use(vhost(/s2\.example\.com/, server2));
server.use(vhost({
host: 's3.example.com',
app: server3
}));
server.use(vhost([{
host: 's4.example.com',
app: server4
}, {
host: /s5\.example\.com/,
app: server5
}]));
server.use(function * (next) {
this.body = 'default server';
});
server.listen(3000, function() {
console.log('server listening port 3000');
}); Then write to your
Then request request request request request request LicenseMIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论