Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mkanenobu/hono-get-node-incoming-message


https://github.com/mkanenobu/hono-get-node-incoming-message

Last synced: 25 days ago
JSON representation

Awesome Lists containing this project

README

        

# hono-get-node-incoming-message

Usage

```typescript
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,
});
```