vendredi 13 juillet 2018

Gin-Gonic EmberJS routing

I have an issue and I'm not quite certain how to get around it.

Basically I have a GIN server running and have Ember as the frontend. Basically the issue I have is when I reach out to my Ember routers, GIN grabs them and says they couldn't be found. It does however send the initial index route from my ember app.

If I have:

r.Use(static.Serve("/", static.LocalFile("./emberpages/public", true)))

The above does render my index correctly and I can redirect within the index.js router however if I try to get to a different page by appending hte route everything seems to crap out and GIN says it couldn't find the file.

Eg.

https://myserver/register  = 404 from gin

https://myserver = 200 serves the index.html page and the index route.

My question is, how can I redirect all of the get requests for my ember app to the ember router without GIN commandeering them?

router.js

Router.map(function () {
    this.route('login');
    this.route('register');
    this.route('dashboard');
});

Note: If I call the following in my controller, the register page loads correctly so ember is routing correctly it is just GIN taking over hardtyped get request.

this.transitionToRoute('register') 




Aucun commentaire:

Enregistrer un commentaire