#apollo-node-setup

1 messages · Page 1 of 1 (latest)

shell cedarBOT
fleet vine
#

Hey @fluid jungle ! Where exactly to you get a 404 and what exact error(s) do you get?

fluid jungle
#

I can provide screenshots of my terminal if needed however the 404 occurs at "POST /create-checkout-session" Error (404): "Not found"

fleet vine
#

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?

fluid jungle
#

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

fleet vine
#

okay so did you mostly download that zip and are a bit confused overall about it? Have you written node code before?

fluid jungle
#

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

fleet vine
#

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

fluid jungle
#

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

fleet vine
#

I'd recommend starting fresh and redownloading the code and running it from there

fluid jungle
#

That was a thought, is there anyway to surely delete npm so I can start fresh?

fleet vine
#

that isn't really a thing. npm is a tool you use to run Node.js command, you don't really "delete it"

fluid jungle
#

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?

fleet vine
#

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)

fluid jungle
#

Okay so Its not necessary to do that then

#

Also should I just delete the package.json files before resetting

fleet vine
#

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

fluid jungle
#

That sounds like that is probably the case, so just re installing should do the trick?

fleet vine
#

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

fluid jungle
#

Should I use the doc or the readme since the instructions are slighly different?

fleet vine
#

I'd follow the readme I guess

fluid jungle
#

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?

shell cedarBOT
fluid jungle
#

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

ebon saffron
#

👋 taking over here. Let me know if you need more help

fluid jungle
#

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.

ebon saffron
#

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

fluid jungle
#

Okay sounds good ill keep you posted

fluid jungle
#

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

ebon saffron
#

Sure. Any error message? or screenshot?

fluid jungle
#

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?

ebon saffron
#

Yes, okay so how did you create that Price? via Dashboard?

fluid jungle
#

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?

ebon saffron
#

Okie now you have everything working, you should modify your code to simulate the Stripe example structure

fluid jungle
#

Since im using stripes page (although ill spice it up) do I just need to put my homepage files in the public folder?

ebon saffron
#

Likely yes, you can reference how public folder is structured in the Stripe sample code