I am setting up a Next.JS site and would like to retrieve the site url. For example, if I have a local install, then the site url would be localhost:3000
. If I deploy the site, then it would be www.my-domainame.com
.
I thought I could do this via the next.js useRouter
hook. But upon closer look it does not seem to return that information. It has information about the path and query, but not about the site url.
As such, I am wondering -- how can I do this in Next.JS?
Thanks.