@hono/node-server
Advanced tools
Comparing version 1.11.2 to 1.11.3
@@ -86,2 +86,12 @@ "use strict"; | ||
}; | ||
if (method === "TRACE") { | ||
init.method = "GET"; | ||
const req = new Request(url, init); | ||
Object.defineProperty(req, "method", { | ||
get() { | ||
return "TRACE"; | ||
} | ||
}); | ||
return req; | ||
} | ||
if (!(method === "GET" || method === "HEAD")) { | ||
@@ -88,0 +98,0 @@ init.body = import_node_stream.Readable.toWeb(incoming); |
@@ -80,2 +80,12 @@ "use strict"; | ||
}; | ||
if (method === "TRACE") { | ||
init.method = "GET"; | ||
const req = new Request(url, init); | ||
Object.defineProperty(req, "method", { | ||
get() { | ||
return "TRACE"; | ||
} | ||
}); | ||
return req; | ||
} | ||
if (!(method === "GET" || method === "HEAD")) { | ||
@@ -82,0 +92,0 @@ init.body = import_node_stream.Readable.toWeb(incoming); |
@@ -73,2 +73,12 @@ "use strict"; | ||
}; | ||
if (method === "TRACE") { | ||
init.method = "GET"; | ||
const req = new Request(url, init); | ||
Object.defineProperty(req, "method", { | ||
get() { | ||
return "TRACE"; | ||
} | ||
}); | ||
return req; | ||
} | ||
if (!(method === "GET" || method === "HEAD")) { | ||
@@ -75,0 +85,0 @@ init.body = import_node_stream.Readable.toWeb(incoming); |
@@ -5,3 +5,3 @@ import { Context, MiddlewareHandler } from 'hono'; | ||
/** | ||
* Root path, relative to current working directory. (absolute paths are not supported) | ||
* Root path, relative to current working directory from which the app was started. Absolute paths are not supported. | ||
*/ | ||
@@ -8,0 +8,0 @@ root?: string; |
@@ -82,2 +82,12 @@ "use strict"; | ||
}; | ||
if (method === "TRACE") { | ||
init.method = "GET"; | ||
const req = new Request(url, init); | ||
Object.defineProperty(req, "method", { | ||
get() { | ||
return "TRACE"; | ||
} | ||
}); | ||
return req; | ||
} | ||
if (!(method === "GET" || method === "HEAD")) { | ||
@@ -84,0 +94,0 @@ init.body = import_node_stream.Readable.toWeb(incoming); |
@@ -80,2 +80,12 @@ "use strict"; | ||
}; | ||
if (method === "TRACE") { | ||
init.method = "GET"; | ||
const req = new Request(url, init); | ||
Object.defineProperty(req, "method", { | ||
get() { | ||
return "TRACE"; | ||
} | ||
}); | ||
return req; | ||
} | ||
if (!(method === "GET" || method === "HEAD")) { | ||
@@ -82,0 +92,0 @@ init.body = import_node_stream.Readable.toWeb(incoming); |
{ | ||
"name": "@hono/node-server", | ||
"version": "1.11.2", | ||
"version": "1.11.3", | ||
"description": "Node.js Adapter for Hono", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -158,4 +158,25 @@ # Node.js Adapter for Hono | ||
Note that `root` must be _relative_ to the current working directory - absolute paths are not supported. | ||
Note that `root` must be _relative_ to the current working directory from which the app was started. Absolute paths are not supported. | ||
This can cause confusion when running your application locally. | ||
Imagine your project structure is: | ||
``` | ||
my-hono-project/ | ||
src/ | ||
index.ts | ||
static/ | ||
index.html | ||
``` | ||
Typically, you would run your app from the project's root directory (`my-hono-project`), | ||
so you would need the following code to serve the `static` folder: | ||
```ts | ||
app.use('/static/*', serveStatic({ root: './static' })) | ||
``` | ||
Notice that `root` here is not relative to `src/index.ts`, rather to `my-hono-project`. | ||
### Options | ||
@@ -162,0 +183,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
162279
4931
286