Skip to content

Doesnt seem to route properly when html5mode is activated #34

@HadrienPierart

Description

@HadrienPierart

I can see this code in the server.js file :

var route = parse_qs(request.url)._escaped_fragment_;
var url = urlPrefix
  + request.url.slice(1, request.url.indexOf('?'))
  + '#!' + decodeURIComponent(route);
renderHtml(url, function(html) {
    response.statusCode = 200;
    response.write(html);
    response.close();
});

Clearly, this creates a route prefixed with '#!' which breaks my router which is configured for urls like localhost:8080/signup and not localhost:8080#!/signup.

This results in having only the / url supported and properly indexed. Any other url will simply render / content...
I tried to remove '#!' from your source code in the server to test it, and it works fine now.

This needs to be compatible with html5mode now.

Great work though, it served me a lot on multiple projects, thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions