Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/mkanenobu/hono-get-node-incoming-message
- Owner: mkanenobu
- License: mit
- Created: 2024-01-08T02:53:23.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-08T03:18:32.000Z (about 1 year ago)
- Last Synced: 2024-12-08T03:42:52.569Z (about 1 month ago)
- Language: TypeScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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,
});
```