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.
@@ -227,9 +227,11 @@ export class ZumitoFramework {
227
227
  });
228
228
  });
229
229
  // throw 404 if URL not found
230
- this.app.all('*', (req, res) => {
231
- return ApiResponse.notFoundResponse(res, 'Page not found');
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');
@@ -23,5 +23,6 @@ export interface FrameworkSettings {
23
23
  }[];
24
24
  webServer?: {
25
25
  port: number;
26
+ disableNotFoundHandler?: boolean;
26
27
  };
27
28
  }
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) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zumito-framework",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "description": "Discord.js bot framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",