#apollo-node-setup
1 messages · Page 1 of 1 (latest)
Hey @fluid jungle ! Where exactly to you get a 404 and what exact error(s) do you get?
I can provide screenshots of my terminal if needed however the 404 occurs at "POST /create-checkout-session" Error (404): "Not found"
apollo-node-setup
I'm not really a node expert so yeah I would need more details about your set up first and what the problem is
like what doc are you following? How are you starting your server?
I am following https://stripe.com/docs/checkout/quickstart The prebuilt checkout page. I followed this doc and the issue im having does not seem to pertain to anything in the doc itself. I npm install --save stripe and use the npm start command to start the server
okay so did you mostly download that zip and are a bit confused overall about it? Have you written node code before?
Not before this but I had no issues with the zip file or anyting in that regard. The issue is with the POST method that cannot seem to get to /create-checkout-session
Yes but taht usually means you aren't running the server properly on your server or have conflicts with your client
Are you using React maybe? Sorry it's not easy to help with something like this
I am not using react. I followed the doc and the read me that came with the zip and i ran into this issue. Initially I thought it was because I was using live server extension on VS code but I have since been running npm for everything so live server does not interfere. Im thinking the fact that I have 2 package.json files means npm is running where it should not
I'd recommend starting fresh and redownloading the code and running it from there
That was a thought, is there anyway to surely delete npm so I can start fresh?
that isn't really a thing. npm is a tool you use to run Node.js command, you don't really "delete it"
Well I have installed server packages with that command, and I feel as if they should be cleared before starting fresh, is there any recommendations?
the package installs are local to that folder usually in a .node_modules folder so that shouldn't be a problem (and it's unlikely to be a package issue)
Okay so Its not necessary to do that then
Also should I just delete the package.json files before resetting
you can try but that is usually irrelevant
it's more likely that you have a rogue npm start command running without the right code for it
That sounds like that is probably the case, so just re installing should do the trick?
I'm not sure, I'm purely guessing right now. Just saying the word "re installing" confuses me because it's not like installing software
I would
1/ reboot
2/ download the code again in a new folder
3/ follow the exact steps to start the server properly
Should I use the doc or the readme since the instructions are slighly different?
I'd follow the readme I guess
Just so theres no issues, when I import the code, I notice it comes with the public folder which contains the webpages for success and cancel. Should I move my content in that folder or put whatever is in stripes public folder in my public folder?
Last time I put the content from stripes public folder in my public folder, just trying to cross all my Ts on the second attempt
👋 taking over here. Let me know if you need more help
Yeah at this point im just starting over as far as importing the code, and im just making sure I didn't make a mistake last time
So in my vs code, I already have a server folder with a public folder and the public folder has my homepage content inside of it, I also see stripes sample folder has its own public folder with the success/cancel webpages. How should I go about importing this in my code? I don't wanna make a mistake if that was the case last time.
I would recommend running the Stripe example code first, separately. After you get it working, you can start on importing/copying its structure to your project
Okay sounds good ill keep you posted
So I got to the checkout page using the local port link however clicking checkout to create a checkout session still throws an error, however the script code in the terminal provides a requestID and potentially useful information for you to help me more
Sure. Any error message? or screenshot?
I will send screenshot
Here is two since it cuts off and I want you to see all of the messages in terminal
It seems to be my price ID.... I am in test mode, what should I be using as the price ID in test mode?
Yes, okay so how did you create that Price? via Dashboard?
Oh my goodness.....
So I was using live price IDs, and noticed that test mode had different price IDs......
Can I now just put my code into this public folder that stripe has provided?
Okie now you have everything working, you should modify your code to simulate the Stripe example structure
Since im using stripes page (although ill spice it up) do I just need to put my homepage files in the public folder?
Likely yes, you can reference how public folder is structured in the Stripe sample code