R
Railway

✋|help

how to setup webhooks?

Ttenkaklet9/16/2023
Hey guys I'm looking for how to setup a deploy webhook similar to vercel for my website with sanity.io?
I'm following this tutorial ( https://www.freecodecamp.org/news/how-to-build-a-portfolio-site-with-sanity-and-nextjs/#step-7-deployment ) any ideas would be amazing!
Ttenkaklet9/16/2023
N/A
Ffragly9/16/2023
You mean like webhooks that automatically trigger a redepoy? because that's done automatically for you on railway
Ttenkaklet9/16/2023
ok cool but where do I a) get the webhook from railway? 🙂
Ttenkaklet9/16/2023
in my dashboard
Ttenkaklet9/16/2023
I'm here atm
Ttenkaklet9/16/2023
I'm on my project settings page of my app on railway
my project id is 4e9575d2-24bb-4039-9954-12f128b13bfd
@fragly hey? @Percy
Ffragly9/16/2023
Oh, I guess that's something else then, I've never used sanity.io so not quite sure what that webhook would do or what fields it requires
Ttenkaklet9/16/2023
I can explain: They just neeed the webhook with is generated from railway. I can't see an automatic webhook generation button or something. So to iterate. they just need the automatic webhook url generated from railway. Did that answer your Q?
Much appreciated for the help @fragly as its for my portfolio and I misspelled my github handle hehe
Ffragly9/16/2023
well, I don't think railway has any generated webhook urls, not 100% sure on that though
but last case scenario, you can make a proxy between railway and sanity.io
Ttenkaklet9/16/2023
Do does one setup a proxy? and do i have to use railway project to do so or on my local machine?
I found this https://docs.railway.app/diagnose/webhooks and if I put in tenkaklet.com ( my site ) as the webhook. would that suffice?
What do you think if I just do https://tenkaklet.com/webhook and put that into the railway webhook input and then add that to the sanity.io webhook. that sound maybe like a plan? @fragly
https://tenkaklet.com/api/webhook
Ffragly9/16/2023
like a proxy? I mean assuming it's set up correctly - maybe, idk
I've never used sanity.io before so I have no idea what specifically is needed for it to work accurately

someone who knows more than I do on this topic will probably be able to help you
Ttenkaklet9/16/2023
sure I understand. Sanit.io just needs an endpoint to communicate with thats it 🙂
I'll try it
No that didn't work
Is there anyone you could get on this @fragly ?
Ffragly9/16/2023
vin or brody probably could, but don't ping them - pinging conductors is against the rules of this server
Ttenkaklet9/16/2023
ok, I understand thanks
i'll try on my own¨
Bbrody1929/16/2023
so you want railway to call a webhook url when what happens?
you have to explain this so that someone who knows nothing about sanity but does know about railway can still help you
Ttenkaklet9/16/2023
I just need a custom url from railway to point to sanity.io that then can send the updated database changes to https://tenkaklet.com
if you go to https://tenkaklet.com/studio you'll see that I can make changes in the backend (though I know you need a password, nvm that part just meaning its a cms ) and then when a change is made in /studio the changes would reflect on tenkaklet.com. Is that ok info? 🙂
Bbrody1929/16/2023
nope lol
Ttenkaklet9/16/2023
is there a way to auto generate a webhook url from railway?
ah damn 😛
Bbrody1929/16/2023
what do you want this webhook from railray to do
Ttenkaklet9/16/2023
just need a custom webhook to make the changes. that's it 😛
Bbrody1929/16/2023
what changes
Ttenkaklet9/16/2023
in sanity.io a cms, It needs an endpoint to be able to send the changes to
this endpoint wasn' t good enough (https://tenkaklet.com/api/webhook )
so if railway can it make a custom or auto generated webhook?
that is connected to my project on railway
Bbrody1929/16/2023
why wasnt it good enough
Ttenkaklet9/16/2023
cause next.js sees it as a page and gives a 404 😦
click it and you'll see :p
Bbrody1929/16/2023
then you need to implement an api route to do what you want
Ttenkaklet9/16/2023
Ok then I'll do that. Just thought that railway does a auto generate webhook url?
does the CLI do that maybe?
Bbrody1929/16/2023
i still dont know how a railway webhook would help you here
Ttenkaklet9/16/2023
here
Bbrody1929/16/2023
this is something that happens inside your app, thus you need to be doing the webhook, not railway
Ttenkaklet9/16/2023
ok aight I'll do that then I guess. thanks man
Bbrody1929/16/2023
railway has no control over the code once its running
Ttenkaklet9/16/2023
ok ok
fixed it. thanks guys

Looking for more? Join the community!

Recommended Posts
Template services in forked environment not deployingHi! When I create a new environment from the base one the two services, that I created from a templaHow can I update the file permissions inside a railway development instance?I receive this error: "PermissionError: [Errno 13] Permission denied: './src/engines/komodo-14/LinudockerIs it possible to use commands or access through a terminal a docker image? I have a Docker image ofDeployment failingI am trying to deploy some updates to my app and I am getting errors during the build process. DockPayload CMS app 500 errorURL: https://edit.gravybo.at/ ID: 9c654a5e-96b8-42bd-a2a0-d82a9e0b8d11 App builds/runs locally, howConfiguring Redis TemplateHi, I was wondering how we can configure the new Redis from the templates. In particular setting theNew deployments maxing out RAM?I have no idea why this started happening, but any new deployments made for one of my services now mPlease help, we are down during a live eventI am not sure what is wrong, everything was working fine but now we cannot access the site. I lookedError installing Python Packages via requirements.txt inside Docker buildProject ID: 1b6776e2-c07c-4f4f-8d54-cd1c9aee3de0 I am trying to deploy an application via DockerHow can I set usage limits?Hello! Following the latest changelog, I wanted to configure usage limits and reading the documentatWhat Postgres Version is railway usingWhat Postgres Version is railway usingcredit missingHello, before the railway plan rework, I purchased $5 credits. Now after the rework, I only have theSomebody got a working PostHog Template?The current template in the marketplace is not deploying: https://railway.app/template/16rDubUpgrading NixPacks NodeJS from 18.12.1 to 18.14.1I tried to deploy an Astro.build 3.1.0 I get a build error that my node version is incorrect: ``` 0.Many print statements are missing from logs?Hello! I have been using railway for a couple months now I have my program sysout a couple thousand All cron jobs skippedProject ID: `f3ce15da-e811-4392-8e64-d21d3ca5660e` I have a project with a cron job that runs everyError deploy flaskHii, im having a problem with my project, can someone help me Project ID 0f9c813d-b8f5-4b7c-aa00-adHelp with webhooksRailway doesn't call my webhook, but i can manually call it through postmanDeleted MySQL DatabaseHow do I recover a deleted database without backup. projectId: e28cd36d-0d6f-4588-a03f-b54a6e97d1Connect to services using Private NetworksProject ID: 1790d4a8-0e32-4b4e-bf67-6ce23d7ae9e1 I'm trying to connect my main project (Node.js) to