@ccci/micro-server 0.0.4 → 0.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.
Files changed (2) hide show
  1. package/dist/index.js +4 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -72961,7 +72961,7 @@ var ISSUER = process.env.JWT_ISSUER ? process.env.JWT_ISSUER : "*.service";
72961
72961
  var API_CONTEXT = process.env.API_CONTEXT || "api";
72962
72962
 
72963
72963
  class RouterFactory {
72964
- constructor(app, folderName = "routes") {
72964
+ constructor(app, pathName, folderName = "routes") {
72965
72965
  try {
72966
72966
  fs.readdirSync(folderName).forEach((dir) => {
72967
72967
  var routerDir = path.join(folderName, dir);
@@ -72970,7 +72970,7 @@ class RouterFactory {
72970
72970
  if (file.toLowerCase().indexOf(".js") || file.toLowerCase().indexOf(".ts")) {
72971
72971
  let fileName = fullName.replace(folderName, API_CONTEXT).replace(".js", "").replace(".ts", "").split("\\").join("/");
72972
72972
  let endpoint = `/${fileName}`;
72973
- let routeFile = `../${fullName}`;
72973
+ let routeFile = `${pathName}/${fullName}`;
72974
72974
  import(routeFile).then((routerClass) => {
72975
72975
  let router = new routerClass.default;
72976
72976
  app.use(endpoint, (req, res, next) => this.authenticate(req, res, next, router.grantPublicAccess), router.getRoutes());
@@ -73394,8 +73394,9 @@ var constructErrors = function(errors) {
73394
73394
 
73395
73395
  // src/utils/DatabaseConnector.ts
73396
73396
  import fs2 from "fs";
73397
+ var __dirname = "/Users/ariel/work/bun-server/src/utils";
73397
73398
  var env = "development";
73398
- var configPath = "config/config.json";
73399
+ var configPath = `${__dirname}/config/config.json`;
73399
73400
 
73400
73401
  class DatabaseConnector {
73401
73402
  static connections;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "0.0.4",
3
+ "version": "0.0.7",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",