You probably want to read req.headers.host, that'll tell you which
domain the request is for (such as example.com or example.net).

Note: if you are serving on a non-standard port, that'll contain the
port too, such as example.com:8080, so split on the colon to get the
host separately.

Cheers,
Andy

On 3 February 2012 11:09, Martin Šnajdr <[email protected]> wrote:
> Hello,
>
> does anybody know, how to allow registered user (of my app) to map a
> custom domain to his profile?
>
> I mean -
> usercustomdomain.com => user.myapp.com
> usercustomdomain.com/someaction => user.myapp.com/someaction
>
> I think I know the basic approach to do that - user points his domain
> to my app's IP address and then he adds a reference to this custom
> domain in his profile. But I don't know how to implement it with node
> (express).
>
> Thank you!
>
> -M
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en



-- 
Andrew Chilton
e: [email protected]
w: http://www.appsattic.com/
p: +64 21 891 681

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to