Call a webhook endpoint using cron
ignisda
HOBBYOP

2 years ago

I would like to trigger an endpoint on a cron schedule. I am aware that railway already provides a way to spin up a service and do so, but I was wondering if there was a way to do it such that I only need to setup an endpoint using the internal networking feature. That way I will not have to create a new service.

44 Replies

ignisda
HOBBYOP

2 years ago

Since railway already runs on GCP, this should be not be very difficult to implement


ignisda
HOBBYOP

2 years ago

or maybe it would be difficult, i cant really assume that


2 years ago

not sure how GCP comes into play here


ignisda
HOBBYOP

2 years ago

GCP's cron scheduler has this feature built-in


2 years ago

right but railway already supports cron in a far more versatile way


2 years ago

you could spin up a ubuntu image on a schedule and use curl in the start command


ignisda
HOBBYOP

2 years ago

im aware of it's versatility but it also ends up with me writing around 20 lines of code to do something that should be achievable in 1


2 years ago

^


ignisda
HOBBYOP

2 years ago

^


2 years ago

please read my message


2 years ago

no code would be involved


ignisda
HOBBYOP

2 years ago

can I use variables in the railway's start command?


2 years ago

of course -


ignisda
HOBBYOP

2 years ago

how do i do this?


2 years ago

please read the docs page i linked


ignisda
HOBBYOP

2 years ago

is there a railway variable for internal url? I am trying ${{App.RAILWAY_STATIC_URL}} but that resolves to the public url


ignisda
HOBBYOP

2 years ago

and i dont want to hardcode app.railway.internal


2 years ago

yes there is -


ignisda
HOBBYOP

2 years ago

it fails without any logs

1281861190586470400


2 years ago

project id please


ignisda
HOBBYOP

2 years ago

1281861478822973400
1281861479100059600


ignisda
HOBBYOP

2 years ago

6ef7539d-c186-4609-a904-178fd8fa7fa0


2 years ago

please read the docs page i linked


ignisda
HOBBYOP

2 years ago

thats weird

1281861899952324600


ignisda
HOBBYOP

2 years ago

pretty sure ubuntu has it


2 years ago

ubuntu the desktop install does, the ubuntu docker image does not, you need to use an image with curl such as chainguard/curl


ignisda
HOBBYOP

2 years ago

TIL


ignisda
HOBBYOP

2 years ago

it failed again without any logs


2 years ago

try this image instead - curlimages/curl


2 years ago

your APP_URL is also incorrect, please read this docs section -


ignisda
HOBBYOP

2 years ago

Thanks that worked


2 years ago

awesome!


2 years ago

see, it was easy! and you were thinking youd need to write code!


ignisda
HOBBYOP

2 years ago

i keep getting this error

1281998404808999000


2 years ago

is this website listening on ipv6 and port 8080?


ignisda
HOBBYOP

2 years ago

not sure how to check that


ignisda
HOBBYOP

2 years ago

you mean i should change it to 0.0.0.0?


2 years ago

you would check that in your code and or start command


2 years ago

note quite, that's ipv4


ignisda
HOBBYOP

2 years ago

it is already running on that


ignisda
HOBBYOP

2 years ago

what do i need to do?


2 years ago

please read the docs section -


ignisda
HOBBYOP

2 years ago

alright that worked


2 years ago

awesome


Loading...