Is it possible to dynamically add subdomain names to a custom domain that is pointing to your heroku app?
For example, you're creating an app that allows users to create their own pages. Let's say www.example.com
is pointing to your heroku app and a user named John makes a page and your app creates john.example.com
that has johns content.
For node, can you do this through routing in express?
Yes. You can indeed dynamically add domains to your Heroku app using the Heroku Platform API. Here's a link to the exact bit you need: https://devcenter.heroku.com/articles/platform-api-reference#domain
You can then read in the domain data via the node request object (req.url
, I believe).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With