How to connect my Railway API on a subdomain in Hostinger

154 Views Asked by At

Basically, I created a subdomain on Hostinger, and after creating it, I replaced the IP of this subdomain to point to the IP of my API on Railway

Railway: Railway

Hostinger: enter image description here

However, when testing the URL in Postman, I end up receiving the following response, which seems to me like it didn't work. Did I do something wrong? enter image description here

1

There are 1 best solutions below

0
On

I found the issue, it was indeed in the NestJS API. I needed to add the correct host in relation to the subdomain. The controller notation looked like this:

@Controller({ host: process.env.SUB_DOMAIN_URL, path: 'user'})