Best URL structure appoach
In my application I have the following url structure where by, things like
the profile page will load data based on the logged in user if no username
is provided and load a different users profile if one is e.g.
/profile - loads logged in users profile
/profile/eddy - loads eddys profile
However things have gotten a little messy take for example a note.
/note/view/note-book-slug/note-slug
I can either follow the same pattern as the profile page and have an
optional last parameter for username otherwise loading the logged in user
data e.g.
/note/view/note-book-slug/note-slug - Find a logged in users note
/note/view/note-book-slug/note-slug/eddy - Find a note owned by eddy
But that does not look like it makes much sense, so my thoughts would be
to require the username as the first param for all resources regardless of
whether we want a logged in users data or someone else's.
Are my thoughts correct / the best approach, or am I looking at this in
the wrong way?
No comments:
Post a Comment