Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember - Force https with heroku

I've made a ember app deployed on heroku. Heroku provides me an ssl certificat so https is working on my website.

I want to force visitors to uses https. I've found some answer telling to do-it in a client side, but since the client can modify JS he will be able to pass-by the force https.

I'm thinking about doing it in a beforeModel of the ember app. What's the best approach ? Many thanks

like image 924
Djamel Avatar asked Mar 08 '23 08:03

Djamel


1 Answers

So guys, I was able to force HTTPS by adding a static.json in my root folder of the app.

And in this static.json just add

{
  "https_only": true
}

commit, push to heroku and that's it !

like image 198
Djamel Avatar answered Mar 15 '23 17:03

Djamel