I'm using Express and Node. Use Fetch to POST some data to the server. I'm getting a 405 error. I don't know how to solve this problem.
P粉0434322102024-04-02 20:14:38
From what I can see in the screenshot, your node application is running on port 3000, but the error on the console indicates that you are getting a 405 error on localhost, but the port 5501.
Is it possible that you are trying to access the wrong URL?
P粉2564870772024-04-02 10:35:56
Just get the node app from "app.listen" by editing:
fetch('api', options)
to
fetch('http://localhost:3000/api', options)
index2.html Line 27