minimonolith 0.2.6 → 0.2.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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "minimonolith",
3
3
  "type": "module",
4
- "version": "0.2.6",
4
+ "version": "0.2.7",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -4,9 +4,11 @@ import { registerModel } from '../databaseHandler/modelsHandler.js';
4
4
  import { methodHandler } from './methodHandler.js';
5
5
  import { registerMethods } from './registerMethods.js';
6
6
 
7
- const serviceHandler = async (API, SERVICE_NAME, SRC_FOLDER='src', MODULE_FOLDER='node_modules') => {
7
+ //const serviceHandler = async (API, SERVICE_NAME, SRC_FOLDER='src/', MODULE_FOLDER='node_modules/') => {
8
+ const serviceHandler = async (API, SERVICE_NAME, SRC_FOLDER='') => {
8
9
  try {
9
- const SERVICE_URL = new URL(`./${SRC_FOLDER}/${SERVICE_NAME}/`, url.pathToFileURL(process.cwd()+'/'));
10
+ const RELATIVE_SERVICE_PATH = './' + SRC_FOLDER + `${SERVICE_NAME}/`;
11
+ const SERVICE_URL = new URL(RELATIVE_SERVICE_PATH, url.pathToFileURL(process.cwd()+'/'));
10
12
  const SERVICE_MODULE = await import(`${SERVICE_URL}index.js`);
11
13
 
12
14
  if (SERVICE_MODULE.modelSchema) registerModel(SERVICE_NAME, SERVICE_MODULE.modelSchema);