Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sammy needs basepath in a route in order to get it working #255

Open
ghost opened this issue Oct 19, 2016 · 2 comments
Open

Sammy needs basepath in a route in order to get it working #255

ghost opened this issue Oct 19, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 19, 2016

The base url for my site is http://localhost:23773/mvn
I feed it a route like this, as per the instructions on sammyjs.org:

var app = $.sammy(function () {
                this.get('#/advantages', function (context) {
                    console.log('advantages'); 
                });
            });


$(function () {
    app.run('#/advantages');
});

Then, I request http://localhost:23773/mvn/#advantages. Instead of running the "#/advantages" route I fed it, it gives me this error:

body 404 Not Found get /mvn/#advantages Error: 404 Not Found get /mvn/#advantages (…)

I'm surprised. Why is the '/mvn' included in the route? If I understand correctly, it shouldn't be there at all.

@pushkeryadav
Copy link

pushkeryadav commented Oct 21, 2016

@rensdenobel This is because you are running wrong hash route.

You are defining "#/advantages" this route but while running the app you are using "/#advantages". got the difference, place of "/".

use "#/advantages" , it will start working.

@ghost
Copy link
Author

ghost commented Oct 22, 2016

Thanks @pushkeryadav ! Working late is not something we should do regularly ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant