Next.js Discord

Discord Forum

dynamic url

Answered
Indian oil sardine posted this in #help-forum
Open in Discord
Indian oil sardineOP
I want to retrieve user details based on a username provided in the URL, for example, /user/[username]. I intend to display this user's information publicly. Can this be achieved using a server-side component exclusively?

9 Replies

Answer
Indian oil sardineOP
hey @joulev , thank you for answering ,
I'm new to next so how should I get the path in server side and render the detail;

the documents I referred asked me to use useRouter get the user slug and get data using fetch API , but useRouter works in client side :blob_thonkang:
Is there any other way ..
Indian oil sardineOP
Thank you @joulev !!
if you dont mine can you also help with this :blob_aww: https://nextjs-forum.com/post/1154348311466221568
Could you please recommend any GitHub repositories or YouTube channels that can help me dive into Next.js? Thanks in advance :meow_meow: