hono-get-node-incoming-message
v0.0.2
Published
Get Node.js IncomingMessage from Hono context
Downloads
2
Readme
hono-get-node-incoming-message
Usage
import { getIncomingMessage } from "hono-get-node-incoming-message";
import { Hono } from "hono";
import { serve } from "@hono/node-server";
const app = new Hono();
app.get("/", (c) => {
const rawIncomingMessage = getRawIncomingMessage(c);
const ipAddress = rawIncomingMessage.socket.remoteAddress;
return c.text(ipAddress ?? "unknown");
});
serve({
fetch: app.fetch,
});