How to build something triggerable by Railway cron
Currently I use cron-job.org to target a specific endpoint on an Express server I run. My understanding of Railway cron is that it would startup the entire service and therefore not work in the way I'm accustomed to. I'm not sure how to build a railway service that would do the same thing (be triggered by cron and successfully run)
The endpoint just reads a 3rd party API and then puts stuff into a database. How could I convert this to work with Railway? I assume have a service that is just this code but how would I wrap it up such that it ran for Railway cron? (iife? or still express somehow?)
Thanks!
Solution:Jump to solution
railway's cron jobs just redeploy your service, so just have your service do its job upon start and then exit when done
6 Replies
Project ID:
ae96d841-f386-4064-9f46-9e5cfcee52ae
ae96d841-f386-4064-9f46-9e5cfcee52ae
Solution
railway's cron jobs just redeploy your service, so just have your service do its job upon start and then exit when done
Not the move dude
Agree with Brody here, there are packages for any language to run a given function on a cron schedule
Thanks for the help. I played around and am using an IIFE that's successfully running on the cron.
Awesome, glad to hear it