node-server
node-server copied to clipboard
add support for absolute path to serveStatic root
Could you add support for absolute path for the root of the serveStatic?
In my use-case designix-uis, an absolute path to the folder containing the static files is required as tool can be called from any directory. Currently i"m using Express, but i"d like to replace it with Hono and this feature is missing.
The following patch in the file src/serve-static.ts
might be sufficient for supporting the absolute path:
- path = addCurrentDirPrefix(path)
+ if (!/^\//.test(path)) {
+ path = addCurrentDirPrefix(path)
+ }