You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
487 B
21 lines
487 B
'use strict';
|
|
const request = require('../service/request')
|
|
|
|
function factory (app, opts) {
|
|
if (opts.pssaRequest) {
|
|
try {
|
|
for (let r of opts.pssaRequest) {
|
|
if (r.name && r.root) {
|
|
app.fs[r.name] = new request(r.root)
|
|
} else {
|
|
throw 'opts.pssaRequest 参数错误!'
|
|
}
|
|
}
|
|
} catch (error) {
|
|
console.error(error)
|
|
process.exit(-1);
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = factory;
|
|
|