How can I access the domain name and full path in a server component in Next.js 13 using the app directory? In previous versions of Next.js (such as version 12), I could do this using context in the getServerSideProps function, but this is no longer supported in the app directory.
I have a small SaaS app where different domains can point to the same Next.js code, and by passing the domain and pathname, I can get data from the API for that particular account, same like WordPress multisite I think.
Is there a better way to do this in Next.js 13 with the app directory? Please help.