Deep Linking, URL switching

17 views
Skip to first unread message

Matt

unread,
May 10, 2016, 3:15:27 PM5/10/16
to Firebase + EmberJS
On a dev environment, running node... you can easily switch to different urls, for example:

  • your-domain.net you might have: {{#link-to 'profile'}}Profile Page{{/link-to}}
  • clicking this link will load:  your-domain.net/profile ; Hitting refresh, we're still good!
  • However, when you deploy to firebase, you get a different result on reload:
  • Hitting refresh on:  your-domain.net/profile will result in page not found.  
Now I know this is because Firebase is a 'static CDN' and 'node' isn't running there.

So my question is, how we enforce the old way with ember to use hashes... for example:


so we can reload the page? Or is there a better way of doing this?

-Matt

Tim Stirrat

unread,
May 10, 2016, 9:48:34 PM5/10/16
to Matt, Firebase + EmberJS
Hi Matt,

You can set up a rewrite rule in firebase.json that will do this for you:

"rewrites": [ {
  "source": "**",
  "destination": "/index.html"
} ]

This rule makes all deep link urls hit the index.html, just like when using ember serve

Hope that helps!

Tim

--
You received this message because you are subscribed to the Google Groups "Firebase + EmberJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-embe...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages