Skip to content

feat(rsbuild): add Express HTTPS custom server example - #512

Merged
chenjiahan merged 3 commits into
rstackjs:mainfrom
heyq02:feat/rsbuild-express-https
Oct 12, 2026
Merged

chenjiahan merged 3 commits into
rstackjs:mainfrom
heyq02:feat/rsbuild-express-https

Conversation

@heyq02

@heyq02 heyq02 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add rsbuild/express-https: custom Express + https.createServer + Rsbuild middlewares / HMR.
  • Explain why server.https alone does not work with app.listen() (HTTP), and how to pass the same cert into Rsbuild for https/wss clients.
  • Use runtime selfsigned certs so the example needs no local mkcert setup.

Fixes #144

Test plan

  • pnpm --filter @rsbuild-example/express-https build
  • pnpm --filter @rsbuild-example/express-https dev prints https://localhost:<port>/
  • curl -skI https://localhost:<port>/ returns 200 with X-Powered-By: Express
  • Browser opens https://localhost:<port>/ (after accepting the self-signed cert warning) and shows the HTTPS example heading

Made with Cursor

Show how to wrap Rsbuild middlewares with https.createServer and
connectWebSocket, instead of relying on server.https with app.listen.

Fixes rstackjs#144

Co-authored-by: Cursor <cursoragent@cursor.com>

@chenjiahan chenjiahan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you

@chenjiahan
chenjiahan enabled auto-merge (squash) October 12, 2026 10:57
@heyq02
heyq02 requested a review from chenjiahan October 12, 2026 11:09
@chenjiahan
chenjiahan merged commit d2929c8 into rstackjs:main Oct 12, 2026
1 check passed
@heyq02
heyq02 deleted the feat/rsbuild-express-https branch October 12, 2026 11:18
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.

Please provide another example supporting HTTPS over Express

2 participants