How to rebuild service from code?
I have PaylaodCMS +NextJS website. I need to rebuild nextjs website on any changes in payloadCMS. How can I do that using ny webhooks or code?
13 Replies
Project ID:
f1ffdfca-0eb5-4966-b060-cd7eb7df4fed
f1ffdfca-0eb5-4966-b060-cd7eb7df4fed
you would have to call railway's public api
I think the
serviceInstanceRedeploy
mutation would work best for your usecase
https://docs.railway.app/reference/public-apiany example? I am trying 2 different tokens (team and personal) and getting errors
what errors are you getting? how are you using the tokens to authenticate the api requests?
id like to note, if you are trying to redeploy a service that resides within a team/pro account, then you need to use the corresponding team token, otherwise use your personal token
/graphql/v2
personal token
still Not Authorized
hey I wrote that code
well kinda
it doesn't use a bearer token in the headers because it runs in user space and has access to the pages cookies, so it makes the request to the graphql endpoint with the users cookie instead of a token, that is also why it uses the internal endpoint
but if you are using that code in your own code, you need to specify your token in a bearer header
just "Authorization":
Bearer ${railwayToken}
, ?looks good
and now it works 😄
really thanks @Brody
no problem!