Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement ConnInfo helper #180

Merged
merged 5 commits into from
Jul 3, 2024
Merged

Conversation

nakasyou
Copy link
Contributor

I implemented ConnInfo helper for Node.js.

Example:

import { Hono } from 'hono'
import { serve } from '@hono/node-server'
import { getConnInfo } from '@hono/node-server/conninfo'

const app = new Hono()
app.get('/ip-address', c => c.text(`Your IP Address: ${getConnInfo(c).remote.address}`))

serve(app)

The helper uses env to get Node.js HTTP Bindings.
If you'd like to use env, you can write code like:

serve({
  fetch (req, server) {
    return app.get(req, { server })
  }
})

@yusukebe
Copy link
Member

yusukebe commented Jun 27, 2024

Hi @nakasyou

I'll review it but, should we upgrade hono package in the devDependecies?

@nakasyou
Copy link
Contributor Author

@yusukebe probably yes.

@usualoma
Copy link
Member

usualoma commented Jul 2, 2024

Good 👍

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe
Copy link
Member

yusukebe commented Jul 3, 2024

Hi @nakasyou

I've updated the branch to pass the CI. Looks good. Merging now. Thanks!

@yusukebe yusukebe merged commit b8fb04b into honojs:main Jul 3, 2024
4 checks passed
@nakasyou nakasyou deleted the feat/conninfo branch July 7, 2024 00:55
adamnolte referenced this pull request in autoblocksai/cli Jul 24, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@hono/node-server](https://github.com/honojs/node-server) |
[`1.11.4` ->
`1.12.0`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/1.11.4/1.12.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@hono%2fnode-server/1.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@hono%2fnode-server/1.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@hono%2fnode-server/1.11.4/1.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@hono%2fnode-server/1.11.4/1.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>honojs/node-server (@&#8203;hono/node-server)</summary>

###
[`v1.12.0`](https://github.com/honojs/node-server/releases/tag/v1.12.0)

[Compare
Source](https://github.com/honojs/node-server/compare/v1.11.5...v1.12.0)

#### What's Changed

- fix(serve-static): supports extension less files by
[@&#8203;yusukebe](https://github.com/yusukebe) in
[https://github.com/honojs/node-server/pull/183](https://github.com/honojs/node-server/pull/183)
- feat: implement ConnInfo helper by
[@&#8203;nakasyou](https://github.com/nakasyou) in
[https://github.com/honojs/node-server/pull/180](https://github.com/honojs/node-server/pull/180)

#### New Contributors

- [@&#8203;nakasyou](https://github.com/nakasyou) made their first
contribution in
[https://github.com/honojs/node-server/pull/180](https://github.com/honojs/node-server/pull/180)

**Full Changelog**:
honojs/node-server@v1.11.5...v1.12.0

###
[`v1.11.5`](https://github.com/honojs/node-server/releases/tag/v1.11.5)

[Compare
Source](https://github.com/honojs/node-server/compare/v1.11.4...v1.11.5)

#### What's Changed

- fix: make `hono` as external to build by
[@&#8203;yusukebe](https://github.com/yusukebe) in
[https://github.com/honojs/node-server/pull/182](https://github.com/honojs/node-server/pull/182)

**Full Changelog**:
honojs/node-server@v1.11.4...v1.11.5

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone
America/Chicago, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/autoblocksai/cli).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants