Answer the question
In order to leave comments, you need to log in
How to solve routing problem in express nodejs server?
Server.js has the following routes:
app.get("/users/:username/obj.json", objController.index);
app.get("/users/:username", UsersController.show);
$.getJSON("obj.json", function (objects)
... Answer the question
In order to leave comments, you need to log in
See
RFC1808 . The relative URL is relative to the base URL of the page. According to section 3.3 of the referenced document, for the site.com/users/johndoe page, the base URL will be site.com/users. The relative URL becomes site.com/users/obj.json accordingly.
The first thing that comes to mind is to change the user page URL format to something like: site.com/users/johndoe/show. <base>
You can also try playing with the tag .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question