how to setup webhooks?
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!
freeCodeCamp.org
How to Build a Portfolio Site with Sanity and Next.js
Knowing how to handle content is important when creating a personal website for yourself or a client. This is because maintaining and updating a site can result in substantial expenses if you don't do it correctly. This is even more the case if you're building for someone with a
36 Replies
Project ID:
N/A
N/A
You mean like webhooks that automatically trigger a redepoy? because that's done automatically for you on railway
ok cool but where do I a) get the webhook from railway? 🙂
in my dashboard
I'm here atm
I'm on my project settings page of my app on railway
my project id is 4e9575d2-24bb-4039-9954-12f128b13bfd
@fragly hey? @Percy
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
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
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
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
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
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 ?
vin or brody probably could, but don't ping them - pinging conductors is against the rules of this server
ok, I understand thanks
i'll try on my own¨
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
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
Max Carlquist | Developer & Teacher
Max Carlquist a developer and teacher based in Helsingborg, Sweden.
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? 🙂
nope lol
is there a way to auto generate a webhook url from railway?
ah damn 😛
what do you want this webhook from railray to do
just need a custom webhook to make the changes. that's it 😛
what changes
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
why wasnt it good enough
cause next.js sees it as a page and gives a 404 😦
click it and you'll see :p
then you need to implement an api route to do what you want
Ok then I'll do that. Just thought that railway does a auto generate webhook url?
does the CLI do that maybe?
i still dont know how a railway webhook would help you here
here
this is something that happens inside your app, thus you need to be doing the webhook, not railway
ok aight I'll do that then I guess. thanks man
railway has no control over the code once its running
ok ok
fixed it. thanks guys