@hono/node-server
Advanced tools
@@ -63,2 +63,5 @@ "use strict"; | ||
| const optionPath = options.path; | ||
| if (root !== "" && !(0, import_node_fs.existsSync)(root)) { | ||
| console.error(`serveStatic: root path '${root}' is not found, are you sure it's correct?`); | ||
| } | ||
| return async (c, next) => { | ||
@@ -65,0 +68,0 @@ if (c.finalized) { |
| // src/serve-static.ts | ||
| import { getMimeType } from "hono/utils/mime"; | ||
| import { createReadStream, lstatSync } from "fs"; | ||
| import { createReadStream, lstatSync, existsSync } from "fs"; | ||
| import { join } from "path"; | ||
@@ -39,2 +39,5 @@ var COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i; | ||
| const optionPath = options.path; | ||
| if (root !== "" && !existsSync(root)) { | ||
| console.error(`serveStatic: root path '${root}' is not found, are you sure it's correct?`); | ||
| } | ||
| return async (c, next) => { | ||
@@ -41,0 +44,0 @@ if (c.finalized) { |
+1
-1
| { | ||
| "name": "@hono/node-server", | ||
| "version": "1.18.2", | ||
| "version": "1.19.0", | ||
| "description": "Node.js Adapter for Hono", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
201222
0.16%5923
0.1%