json-rest-api 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* - File upload support with busboy or formidable
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import
|
|
17
|
+
import { requirePackage } from 'hooked-api';
|
|
18
18
|
import { parseJsonApiQuery } from '../utils/connectors-query-parser.js';
|
|
19
19
|
import { createContext } from './lib/request-helpers.js';
|
|
20
20
|
import { createEnhancedLogger } from '../../../lib/enhanced-logger.js';
|
|
@@ -24,6 +24,14 @@ export const ExpressPlugin = {
|
|
|
24
24
|
dependencies: ['rest-api'],
|
|
25
25
|
|
|
26
26
|
async install({ on, vars, helpers, pluginOptions, log, scopes, api, runHooks, addHook }) {
|
|
27
|
+
// Dynamic import for Express
|
|
28
|
+
let express;
|
|
29
|
+
try {
|
|
30
|
+
express = (await import('express')).default;
|
|
31
|
+
} catch (e) {
|
|
32
|
+
requirePackage('express', 'express',
|
|
33
|
+
'Express.js is required for HTTP server functionality. This is a peer dependency.');
|
|
34
|
+
}
|
|
27
35
|
// Enhance the logger
|
|
28
36
|
const enhancedLog = createEnhancedLogger(log, {
|
|
29
37
|
logFullErrors: true,
|