How to force SSL on projects using tRPC?
Hello everyone,
I'm working on a project that uses create-t3-app as boilerplate. My project is hosted on heroku. I have an issue with forcing HTTPS connection. Before tRPC, I was able to solve this issue by using express-sslify like it was explained in this post on Stack overflow https://stackoverflow.com/questions/67490760/how-to-enforce-ssl-on-a-node-js-app-on-heroku
Is it possible to enforce SSL on projects using tRPC?
Stack Overflow
How to enforce SSL on a Node.js app on heroku?
I'm trying to deploy a Node.js app on Heroku using express, and I am struggling to enforce HTTPS on all incoming traffic. I am using the express-sslify library to do this using the code below, whic...
3 Replies
I would typically handle this at the infrastructure level. DNS and Reverse Proxy, etc
So it helps to know how you're hosting the app
Hey. I'm hosting my project on Heroku
Basically I've tried to use the code from https://www.npmjs.com/package/express-sslify package
By adding a middleware to my procedures, but that resulted in ,dns_probe_finished_nxdomain error on production. Then I found this article on tRPC website https://trpc.io/docs/server/adapters/nextjs
And I've tried to write a custom handler that uses similar logic from the above-mentioned package. But the same error occurred 😔
Code snippet:
npm
express-sslify
Enforces SSL for node.js express projects. Latest version: 1.2.0, last published: 6 years ago. Start using express-sslify in your project by running
npm i express-sslify
. There are 42 other projects in the npm registry using express-sslify.Next.js Adapter | tRPC
tRPC's support for Next.js is far more expansive than just an adapter. This page covers a brief summary of how to set up the adapter, but complete documentation is available here