François Richard
François Richard

Reputation: 7055

Backbone pushstate not catching routes, settting "root" properly

I think I'm missing something basic but I can't find out what, I've checked other post on this topîc but couldn't find a clear answer.

The url launching my app is:

http://local.myapp.ngx:8080/myapp/fileasset/app.html

app.html is loading require/main.js

// MAIN.JS

initializing the router:

      new Router();

starting history:

Backbone.history.start({
            pushState: true,
            root: "/myapp/fileasset/"
});

// ROUTER.JS

    routes: {
        '':'test'
    }

==> PROBLEM , test function is never called.

if I try this:

routes: {
    '*wtv':'test'
}

==> THEN "test" is triggered but how to catch other routes ?

thanks for your help !

Upvotes: 0

Views: 33

Answers (1)

François Richard
François Richard

Reputation: 7055

Indeed it was a really really basic thing, I didn't put the right root

            root: "/myapp/fileasset/ui.html"

Upvotes: 0

Related Questions