R
Join ServerRailway
✋|help
Help deploy a node.js server on railway
I want to deploy some node code with railway
i started with template but its strange
its using .mjs
my code is like this
can I deploy this
or i need to make changes
yes the project is in the format of a node module
not sure what you mean
I wonder if I can just run
railway link
and it will deploy
this might be more what you want
https://github.com/brody192/express-simple
https://github.com/brody192/express-simple
that isn't quite how it works
you will want to fork that repo, clone it to your computer, make the changes you want, push the changes to github, then add a new service from that repo you forked
thanks will try now
cool!
hey @Brody
i am trying to deploy this project with railway now
any problems?
testing it out on stripe side
actually was magical
i did it via ui
oh so no issues?
im trying to change stuff on stripe side
to point to prod url
@Brody can i get logs in railway
oh ok i see it
mm
doesn't seem to work
you changed the template
well duh lol
i mean you changed the part of it that allowed it to work effortlessly on railway
im looking at yours now
please read this docs page to get you back on track
https://docs.railway.app/troubleshoot/fixing-common-errors
https://docs.railway.app/troubleshoot/fixing-common-errors
const port = process.env.PORT || 3000
app.listen(port, () => console.log(`Running on port ${port}`))
ok so i added this
its still failing
unless i miss something else
failing how?
the thing though
well web hooks don't get sent to that url
maybe its a stripe issue
send me the railway domain for that service?
stripe-payment-hooks-production.up.railway.app
btw feature request is so copy gives full url
with https://
not sure why it only gives raw thing
yep, the app works fine
ok then will ask on stripe side
stripe will have some type of logs for why it fails, send them over
and im sure they have a test the webhook endpoint button or something right?
before deploying i was working with it locally
and it worked
stripe listen --forward-to localhost:4242/webhook
i ran this
what endpoint do you have registered to handle the stripe webhooks
and
node index.js
in code
im not sure i get you
is my code for stripe web hooks
i get a checkout page like this
const normalMonthly = await stripe.checkout.sessions.create({
success_url: process.env.STRIPE_SUCCESS_URL!,
mode: "subscription",
metadata: {
userDetailsId: userDetailsId,
},
line_items: [
{
quantity: 1,
price: process.env.STRIPE_NORMAL_MONTH_SUBSCRIPTION!,
},
],
})
created like so
then when users complete the checkout
web hooks should get sent to this railway endpoint
your endpoint is
you need to tell stripe to call that endpoint
/webhook
you need to tell stripe to call that endpoint
ok trying with this
you are missing the
/webhook
endpoint herethank you that worked
awsome
for node apps that you have full control over the codebase, its best to define the start command/script in the package.json file, but i see you dont have one