Angular server-side rendering (SSR) | How to get domain name

Discussão em 'Angular' iniciado por Vingtoft, Janeiro 21, 2025.

  1. Vingtoft

    Vingtoft Guest

    My web application is accessible through multiple domains (example.com example.org example.net).

    Question: How can I access the domain of the current route?

    Please note: I use SSR (server side rendering), answer can therefore not include window or any other browser object.

    Expected result: If application is accessed via example.org and current route is www.example.org/frontpage

    const domain = await someFunction()
    console.log(domain);
    // example.org

    Continue reading...

Compartilhe esta Página