Help Creating Multiple Ports for The Same Project

apexanalyses
HOBBY

5 months ago

I am trying to host a server that allows for a Google Sheets App Script to request screenshots of a Google Sheet, which is then linked to a Discord Webhook that posts the Screenshots. As you can see in the project linked to this thread, all the infrastructure seems to be there coding-wise, but I am having trouble trying to run the code in tandem as one file (server.mjs file) is handling the screenshot requests and is running on port 8080, but the other authenitcation file (auth.js) needs to run a temporary server that allows for authentication so that the automated process can actually access the Google Sheet and apparently needs its own port for that (separate from 8080). I was wondering if I could get some assistance on creating that alternate access point so that they can work in the same project (port I am planning to use for the authorization file is 3001).

5 Replies

5 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 5 months ago


5 months ago

Hello,

You would be looking for our target port feature -

https://docs.railway.com/guides/public-networking#target-ports


brody

Hello,You would be looking for our target port feature -https://docs.railway.com/guides/public-networking#target-ports

apexanalyses
HOBBY

5 months ago

Thanks, but I am still not quite sure on what to do with this... what do I need to do to add a second port to the generated railway domain? So far I have just used the one labeled with "magic." If possible I would like to have two ports running off the same URL that railway generated for me under the public networking section.


5 months ago

Two ports running off the same domain would not be possible.

You need to use two custom domains, one for each port.


apexanalyses
HOBBY

5 months ago

Ok, so how do I get railway to generate a second domain?

Or do I need to provide my own through a third party (like SquareSpace)?


5 months ago

You only get one Railway generated domain per service, you would now need to use a custom domain, though Cloudflare, not squarespace.


Help Creating Multiple Ports for The Same Project - Railway Help Station