zumito-framework 1.14.0 → 1.14.2
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/dist/ZumitoFramework.js
CHANGED
|
@@ -227,9 +227,11 @@ export class ZumitoFramework {
|
|
|
227
227
|
});
|
|
228
228
|
});
|
|
229
229
|
// throw 404 if URL not found
|
|
230
|
-
this.
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
if (!this.settings.webServer?.disableNotFoundHandler) {
|
|
231
|
+
this.app.all('*', (req, res) => {
|
|
232
|
+
return ApiResponse.notFoundResponse(res, 'Page not found');
|
|
233
|
+
});
|
|
234
|
+
}
|
|
233
235
|
this.app.use((err, req, res, next) => {
|
|
234
236
|
if (err.name === 'UnauthorizedError') {
|
|
235
237
|
return ApiResponse.unauthorizedResponse(res, 'Invalid token');
|
package/dist/launcher.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { ZumitoFramework } from './index';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import fs from 'fs';
|
|
6
|
+
import { pathToFileURL } from 'url';
|
|
6
7
|
import dotenv from 'dotenv';
|
|
7
8
|
import { RecursiveObjectMerger } from './services/utilities/RecursiveObjectMerger';
|
|
8
9
|
dotenv.config();
|
|
@@ -30,7 +31,7 @@ if (!fs.existsSync(configFilePath)) {
|
|
|
30
31
|
console.error(`Config file not found at ${configFilePath}. Please ensure the file exists.`);
|
|
31
32
|
process.exit(1);
|
|
32
33
|
}
|
|
33
|
-
import(configFilePath)
|
|
34
|
+
import(pathToFileURL(configFilePath).href)
|
|
34
35
|
.then(({ config: userConfig }) => {
|
|
35
36
|
const config = RecursiveObjectMerger.merge(defaultConfig, userConfig);
|
|
36
37
|
new ZumitoFramework(config, (bot) => {
|