-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
33 lines (26 loc) · 834 Bytes
/
index.js
File metadata and controls
33 lines (26 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict';
const defaultOptions = {
disabledForXHR: true,
disableSourceMapSupport: false,
theme: 'okaidia'
};
module.exports.express = function stack(options) {
const opts = Object.assign({}, defaultOptions, options);
if (process.env.NODE_ENV === 'production') {
throw new Error(
"Error handling middleware should not be used in 'production'"
);
}
// eslint-disable-next-line global-require
return require('./src/middleware/express')(opts);
};
module.exports.koa = function stack(options) {
const opts = Object.assign({}, defaultOptions, options);
if (process.env.NODE_ENV === 'production') {
throw new Error(
"Error handling middleware should not be used in 'production'"
);
}
// eslint-disable-next-line global-require
return require('./src/middleware/koa')(opts);
};