mirror of
https://github.com/abrendan/MicDropMessages.git
synced 2025-06-16 20:55:00 +02:00
11 lines
315 B
JavaScript
11 lines
315 B
JavaScript
const join = require('../src/join');
|
|
|
|
module.exports = (path, ...middle) => async ctx => {
|
|
const full = ctx.req.subdomains.reverse().join('.');
|
|
if ((typeof path === 'string' && path === full) ||
|
|
(path instanceof RegExp && path.test(full))) {
|
|
await join(middle)(ctx);
|
|
ctx.req.solved = true;
|
|
}
|
|
};
|