-
Notifications
You must be signed in to change notification settings - Fork 27k
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
accessing parsed url in getInitialProps #62
Comments
@bmcmahen Actually there is and it's featured here https://github.com/zeit/nextgram/blob/master/pages/photo.js#L5 there is a demo for that app at https://nextgram.now.sh |
But that's accessible only in the |
@bmcmahen – Have you found a way to do this? Running into the same problem now. When rendering client side, {
err: undefined,
xhr: XMLHttpRequest
} When rendering server side, it receives an object like this: {
req: IncomingMessage,
res: ServerResponse,
} I use |
This should be a kind of bugs to be fixed. One way is to execute I think it's great since it's similar to what happens on cc @rauchg |
I accidentally duplicated this here: #188 |
As far as I can tell, the static
getInitialProps
doesn't provide a uniform way to access url params on the client and server. On the server, you can accessreq
and parse the url yourself. On the client, we don't seem to have access to the route information within thegetInitialProps
function. The uses for this are fairly obvious, i think, such as loading a particular user profile based on an:id
param, and so on. I'm also wondering if auth could somehow be implemented here too -- thought I'm less clear if that's the best API.The text was updated successfully, but these errors were encountered: