Skip to content

feat(example): include protocol in startup log URL for clickable terminal links (#1745)#1746

Open
ARUNKUMAR069 wants to merge 2 commits intoelysiajs:mainfrom
ARUNKUMAR069:patch-1
Open

feat(example): include protocol in startup log URL for clickable terminal links (#1745)#1746
ARUNKUMAR069 wants to merge 2 commits intoelysiajs:mainfrom
ARUNKUMAR069:patch-1

Conversation

@ARUNKUMAR069
Copy link

@ARUNKUMAR069 ARUNKUMAR069 commented Feb 17, 2026

This PR improves developer experience by including the protocol (http:// or https://) in the startup log URL shown in example files.

Previously, the startup message displayed:

🔥 Elysia is running at localhost:3000

This change updates it to:

🔥 Elysia is running at http://localhost:3000/

Why

Some terminals only create clickable links when the protocol is included in the URL. Adding the protocol:

  • Enables clickable URLs directly from terminal output
  • Improves developer workflow during local development
  • Aligns behavior with other frameworks such as Vite and Next.js

Implementation

  • Updated example startup log to include protocol prefix.
  • Default protocol is http://.
  • Structure allows future enhancement for automatic protocol detection if TLS is enabled.

Related Issue

Closes #1745

Testing

  • Verified locally using Bun runtime.
  • Confirmed startup log displays full clickable URL.

Summary by CodeRabbit

  • Improvements
    • Server URLs now automatically use HTTP or HTTPS based on TLS configuration.
    • Startup/log output updated to show the correct protocol in URLs and uses a fire emoji prefix.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Updated the example startup log to compute a protocol string ("https" if app.server?.tls is present, otherwise "http") and use it in the printed URL; the log emoji was changed to a fire.

Changes

Cohort / File(s) Summary
Protocol Detection & Log Update
example/lazy-module.ts
Added protocol computed from app.server?.tls to choose "https" or "http", replaced hardcoded scheme in the startup log with the protocol value, and changed the log emoji to a fire.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I sniff the logs at break of day,
http or https — I'll say which way,
A little flame, a clearer link,
Hop, click, and off developers go — wink!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: including protocol in startup log URL for clickable terminal links.
Linked Issues check ✅ Passed The PR implements the protocol variable based on TLS configuration and updates the log to use it, addressing issue #1745's requirement for automatic protocol detection and clickable URLs.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue requirement of including protocol in the startup log URL; the emoji change (fox to fire) is within scope as it's part of the startup log.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ARUNKUMAR069
Copy link
Author

PR opened: #1746

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
example/lazy-module.ts (1)

16-19: Nit: spurious blank lines and missing trailing / in URL.

Lines 16–17 introduce two consecutive blank lines that add noise. The PR description also mentions the URL should end with / (http://localhost:3000/), but the template string omits it.

✨ Proposed cleanup
-

-

 console.log(
-   `🔥 Elysia is running at ${protocol}://${app.server?.hostname}:${app.server?.port}`
+   `🔥 Elysia is running at ${protocol}://${app.server?.hostname}:${app.server?.port}/`
 )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@example/lazy-module.ts` around lines 16 - 19, Remove the two spurious blank
lines around the console.log and update the template string in console.log to
include a trailing slash; specifically, edit the console.log invocation that
prints `🔥 Elysia is running at
${protocol}://${app.server?.hostname}:${app.server?.port}` so there are no extra
blank lines and the URL ends with `/` (e.g., append `/` after
`${app.server?.port}`).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@example/lazy-module.ts`:
- Line 5: The const protocol is declared before app is initialized, causing a
TDZ crash and incorrect TLS detection; move the protocol calculation (the
expression using app.server?.tls) to after the application is fully started
(after awaiting app.modules / after app.listen(3000) has run) — e.g., remove or
relocate the line "const protocol = app.server?.tls ? 'https' : 'http'" and
re-declare it just before the console.log so that app and app.server are
initialized and the true TLS state is observed.

---

Nitpick comments:
In `@example/lazy-module.ts`:
- Around line 16-19: Remove the two spurious blank lines around the console.log
and update the template string in console.log to include a trailing slash;
specifically, edit the console.log invocation that prints `🔥 Elysia is running
at ${protocol}://${app.server?.hostname}:${app.server?.port}` so there are no
extra blank lines and the URL ends with `/` (e.g., append `/` after
`${app.server?.port}`).

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.

Include http:// protocol in startup log URL

1 participant