Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hono/node-server

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hono/node-server - npm Package Compare versions

Comparing version 1.3.5 to 1.4.0

3

dist/serve-static.d.ts

@@ -1,2 +0,2 @@

import { MiddlewareHandler } from 'hono';
import { Context, MiddlewareHandler } from 'hono';

@@ -11,2 +11,3 @@ type ServeStaticOptions = {

rewriteRequestPath?: (path: string) => string;
onNotFound?: (path: string, c: Context) => void | Promise<void>;
};

@@ -13,0 +14,0 @@ declare const serveStatic: (options?: ServeStaticOptions) => MiddlewareHandler;

@@ -174,2 +174,3 @@ "use strict";

if (!(0, import_fs.existsSync)(path)) {
await options.onNotFound?.(path, c);
return next();

@@ -176,0 +177,0 @@ }

{
"name": "@hono/node-server",
"version": "1.3.5",
"version": "1.4.0",
"description": "Node.js Adapter for Hono",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -165,2 +165,18 @@ # Node.js Adapter for Hono

#### `onNotFound`
The `onNotFound` is useful for debugging. You can write a handle for when a file is not found.
```ts
app.use(
'/static/*',
serveStatic({
root: './non-existent-dir',
onNotFound: (path, c) => {
console.log(`${path} is not found, request to ${c.req.path}`)
},
})
)
```
## Related projects

@@ -167,0 +183,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc