fix documentation
This commit is contained in:
parent
1534917132
commit
6baeade4c0
9
index.js
9
index.js
@ -1,12 +1,19 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} options
|
||||||
|
* @property {any} [opts] object to pass to the handlers
|
||||||
|
* @property {string} [subdir] subdirectory for all requests
|
||||||
|
* @property {boolean} [verbose] enable verbose logging
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load all request handlers in the given folder
|
* Load all request handlers in the given folder
|
||||||
*
|
*
|
||||||
* @param {any} app express app
|
* @param {any} app express app
|
||||||
* @param {string} modulefolder folder that contains all modules
|
* @param {string} modulefolder folder that contains all modules
|
||||||
* @param {{opts: any, subdir: string, verbose: boolean}} options
|
* @param {options} options
|
||||||
*/
|
*/
|
||||||
module.exports = function (
|
module.exports = function (
|
||||||
app,
|
app,
|
||||||
|
@ -63,7 +63,7 @@ describe('requestor', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should build requests with subdirectory', () => {
|
it('should build requests with subdirectory', () => {
|
||||||
requestor(mock, './test/sub', {}, 'test');
|
requestor(mock, './test/sub', { subdir: 'test' });
|
||||||
expect(mock.registered).to.have.all.keys([
|
expect(mock.registered).to.have.all.keys([
|
||||||
'post-/test/sub/',
|
'post-/test/sub/',
|
||||||
'get-/test/sub/',
|
'get-/test/sub/',
|
||||||
|
Reference in New Issue
Block a user