@harperdb/http-router
Advanced tools
+5
-4
| const { getCacheHandler } = require('@harperdb/http-cache/extension'); | ||
| const { dirname } = require('path'); | ||
| const { pathToFileURL } = require('url'); | ||
| exports.origins = new Map(); | ||
| exports.baseDir == __dirname; | ||
| exports.baseDir = __dirname; | ||
| exports.start = function (options = {}) { | ||
@@ -11,3 +12,3 @@ let cacheHandler = getCacheHandler(options); | ||
| exports.baseDir = dirname(file_path); | ||
| const moduleExports = (await import(file_path)).default; | ||
| const moduleExports = (await import(pathToFileURL(file_path))).default; | ||
| for (let origin of moduleExports.origins || []) { | ||
@@ -25,3 +26,3 @@ exports.origins.set(origin.name, { | ||
| exports.baseDir = dirname(file_path); | ||
| const moduleExports = (await import(file_path)).default; | ||
| const moduleExports = (await import(pathToFileURL(file_path))).default; | ||
| for (let originName in moduleExports.backends) { | ||
@@ -39,3 +40,3 @@ const origin = moduleExports.backends[originName]; | ||
| exports.baseDir = dirname(file_path); | ||
| let routes = (await import(file_path)).default; | ||
| let routes = (await import(pathToFileURL(file_path))).default; | ||
| if (typeof routes === 'function') routes = routes(); | ||
@@ -42,0 +43,0 @@ const servers = options.server.http(async (request, nextHandler) => { |
+1
-1
| { | ||
| "name": "@harperdb/http-router", | ||
| "version": "0.2.11", | ||
| "version": "0.2.12", | ||
| "type": "commonjs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
24863
0.35%660
0.15%