R
Railway•14mo ago
Tenkaklet

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
Percy
Percy•14mo ago
Project ID: N/A
Tenkaklet
Tenkaklet•14mo ago
N/A
Fragly
Fragly•14mo ago
You mean like webhooks that automatically trigger a redepoy? because that's done automatically for you on railway
Tenkaklet
Tenkaklet•14mo ago
ok cool but where do I a) get the webhook from railway? 🙂
No description
Tenkaklet
Tenkaklet•14mo ago
in my dashboard
Tenkaklet
Tenkaklet•14mo ago
I'm here atm
No description
Tenkaklet
Tenkaklet•14mo ago
I'm on my project settings page of my app on railway my project id is 4e9575d2-24bb-4039-9954-12f128b13bfd @fragly hey? @Percy
Fragly
Fragly•14mo ago
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
Tenkaklet
Tenkaklet•14mo ago
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
Fragly
Fragly•14mo ago
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
Tenkaklet
Tenkaklet•14mo ago
Do does one setup a proxy? and do i have to use railway project to do so or on my local machine?
Tenkaklet
Tenkaklet•14mo ago
I found this https://docs.railway.app/diagnose/webhooks and if I put in tenkaklet.com ( my site ) as the webhook. would that suffice?
Railway Docs
Webhooks | Railway Docs
Documentation for Railway
Tenkaklet
Tenkaklet•14mo ago
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
Fragly
Fragly•14mo ago
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
Tenkaklet
Tenkaklet•14mo ago
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 ?
Fragly
Fragly•14mo ago
vin or brody probably could, but don't ping them - pinging conductors is against the rules of this server
Tenkaklet
Tenkaklet•14mo ago
ok, I understand thanks i'll try on my own¨
Brody
Brody•14mo ago
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
Tenkaklet
Tenkaklet•14mo ago
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.
Tenkaklet
Tenkaklet•14mo ago
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? 🙂
Brody
Brody•14mo ago
nope lol
Tenkaklet
Tenkaklet•14mo ago
is there a way to auto generate a webhook url from railway? ah damn 😛
Brody
Brody•14mo ago
what do you want this webhook from railray to do
Tenkaklet
Tenkaklet•14mo ago
just need a custom webhook to make the changes. that's it 😛
Brody
Brody•14mo ago
what changes
Tenkaklet
Tenkaklet•14mo ago
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
Brody
Brody•14mo ago
why wasnt it good enough
Tenkaklet
Tenkaklet•14mo ago
cause next.js sees it as a page and gives a 404 😦 click it and you'll see :p
Brody
Brody•14mo ago
then you need to implement an api route to do what you want
Tenkaklet
Tenkaklet•14mo ago
Ok then I'll do that. Just thought that railway does a auto generate webhook url? does the CLI do that maybe?
Brody
Brody•14mo ago
i still dont know how a railway webhook would help you here
Tenkaklet
Tenkaklet•14mo ago
here
No description
Brody
Brody•14mo ago
this is something that happens inside your app, thus you need to be doing the webhook, not railway
Tenkaklet
Tenkaklet•14mo ago
ok aight I'll do that then I guess. thanks man
Brody
Brody•14mo ago
railway has no control over the code once its running
Tenkaklet
Tenkaklet•14mo ago
ok ok fixed it. thanks guys
Want results from more Discord servers?
Add your server