bigviking
Proper Connecting String Syntax for Private Services
I must be going insane. Whats the right connection string format to connect to a private service in a Railway network? I've tried:
I am attempting to call a graphql endpoint in one Node service from another using fetch.
The service I am attempting to connect to is running on port 7653. I know this because I have it log process.env.PORT on start.
19 replies
Best Way to Run a Weekly Cron Job
Use case:
I need to poll an external API during several windows throughout the week. The times change each week and no two will be the same (or very rarely). I know what the upcoming week's times will be by polling an endpoint at a particular time in the current week.
This cron job of mine requests data from an external API to compare to data in my networked database and if it detects changes it does things and then updates the database.
Current state:
Currently, I have the cron scripts start up and queue in my Express app after it deploys but they do not run on schedule in Railway, nor at all. The jobs run at the appropriate time locally and works with my local services without error.
Question:
Curious to know the best path ahead or perhaps what I'm doing incorrectly when starting the jobs on Railway. I'd prefer not to but if I have to create a separate service for the cron and use Railway's cron settings in the service settings I'll go down that path.
Thanks!
10 replies
Bind Express App to IPv6?
I deployed my Express API to Railway and its talking to Redis and Postgres nicely. My client is built in Next 13 with the App Router and is having trouble discovering
I think this has to do with my binding the Express app to an IPv6 port or at least making it accessible through IPv6 however after a few hours of searching I'm unable to find a clear way of doing this?
client <> server is communicating through ApolloServer.
This is my app.js in my server root. Thanks for any insights.
45 replies
Connecting to Private Services Node API <> Redis
My node js sever is having troubling finding the redis/redis-stack-server image in the network. I'm using the traditional 6379 port and the redis-stack-server.railway.internal host name but my node DNS keeps throwing
[ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND redis-stack-server.railway.internal
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
When I spin up my node server. This works fine on local and together in a docker compose file with the same redis image locally. What am I doing wrong to connect to the redis-stack-server?56 replies