-
Notifications
You must be signed in to change notification settings - Fork 70
add listeningListener serve function #36
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
Conversation
HI @ibodev1 ! Thanks for creating the PR. It looks good, but I'd like to reconsider the API, particularly for functions like |
Hi @yusukebe. I like your work very much. I like using nodejs very much, I recently started using deno and the hono library is really useful and fast. I have a callback function habit from using node js and express. I had this deficiency in hono and I wanted to open PR. I hope it will help you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for delay. I like this feature and the API. So, I want to merge it.
I've leaved one comment. Check it!
src/server.ts
Outdated
const server = createAdaptorServer(options); | ||
const serverInfo = server.address() as AddressInfo; | ||
const port = serverInfo?.port ?? options.port; | ||
server.listen(options.port || 3000, options.hostname || '0.0.0.0', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first argument of server.listen
should be port
.
hi @yusukebe , No problem mate. i am very glad that you want to merge. is there anything i need to do? i am very new to pull request. and my english is terrible. if there is anything i need to do, i will help if you tell me in detail. thank you. I would like to make a suggestion. if possible a callback function can be added for other adapters. |
As far as I understand from the comment, I made such an update. |
updates
Hi @ibodev1 ! Thanks for updating. I think it would be more convenient to pass the Then we can write the following. serve(app, (info) => { // info is AddressInfo
console.log(`Running on ${info.address}:${info.port}`)
}) |
I made the updates you asked for and committed it. I hope it worked for you. I made an update in the readme file about how the listener is used. |
I edited the readme file under the heading "Usage" instead of opening a separate heading. it is more readable this way. |
Hi @ibodev1 ! Perfect! I'll merge it now. Thanks for your contribution! |
you are welcome. see you in other projects :) |
No description provided.