@ccci/micro-server 1.0.17 → 1.0.18

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/index.js CHANGED
@@ -86884,7 +86884,7 @@ var require_winston = __commonJS((exports) => {
86884
86884
  // src/utils/ApplicationServer.ts
86885
86885
  var import_express = __toESM(require_express2(), 1);
86886
86886
  var import_cors = __toESM(require_lib3(), 1);
86887
- import path2 from "path";
86887
+ import path3 from "path";
86888
86888
 
86889
86889
  // node_modules/helmet/index.mjs
86890
86890
  var normalizeDirectives = function(options) {
@@ -87651,12 +87651,14 @@ class RouterFactory {
87651
87651
 
87652
87652
  // src/utils/WebSocketServer.ts
87653
87653
  import fs3 from "node:fs";
87654
+ import path2 from "node:path";
87654
87655
  class WebSocketServer {
87655
- constructor(port = 3001, path2 = "sockets") {
87656
+ constructor(port = 3001, dir = "sockets") {
87656
87657
  let handlers = [];
87657
- fs3.readdirSync(path2).forEach((file) => {
87658
+ fs3.readdirSync(dir).forEach((file) => {
87658
87659
  if (file.toLowerCase().indexOf(".ts")) {
87659
- import(`./${path2}/${file}`).then((handlerClass) => {
87660
+ let filePath = path2.join(dir, file);
87661
+ import(filePath).then((handlerClass) => {
87660
87662
  let path3 = file.replace(".ts", "");
87661
87663
  let handler = new handlerClass.default;
87662
87664
  handlers.push({ path: path3, handler });
@@ -87718,7 +87720,7 @@ class ApplicationServer {
87718
87720
  await db.connect(conn[0]);
87719
87721
  await db.initializeModels();
87720
87722
  ApplicationServer.app.get("/", (req, resp) => {
87721
- return resp.sendFile(path2.resolve("index.html"));
87723
+ return resp.sendFile(path3.resolve("index.html"));
87722
87724
  });
87723
87725
  Logger.info("Create API Routes...\n");
87724
87726
  new RouterFactory(ApplicationServer.app, process.cwd(), "routes");
@@ -1,4 +1,4 @@
1
1
  export default class WebSocketServer {
2
- constructor(port?: number, path?: string);
2
+ constructor(port?: number, dir?: string);
3
3
  }
4
4
  //# sourceMappingURL=WebSocketServer.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",