javascript - VueJS POST 404 Not Found
one text
Solution:
The problem was caused not by a coding error but due to two webservers being installed on the affected system, a XAMPP installation running on the default port 80 and a Node.Js server running on port 8080.
To diagnose the problem we first copypasted the URL being used in the script into a browser window which gave the same 404 HTTP error. This excluded the option that the axios.post()
method caused the behavior.
Next the basic HTTP port assignment was tested. Calling the address http://10.0.0.20
(user's IP inside the local network) gave the correct XAMPP homepage. When checking the httpd.conf
and in it the Listen
setting (which should have been Listen 8080
) we saw the Apache was using the default HTTP port isntead. Changing it to 8080 (as was used in the script) and restarting Apache resulted in the server not starting with the error:
Problem detected! Port 8080 in use by "C:\Program Files\nodejs\node.exe" with PID 3808! Apache WILL NOT start without the configured ports free! You need to uninstall/disable/reconfigure the blocking application or reconfigure Apache and the Control Panel to listen on a different port.
It was now sure that messed up ports were the cause of the problem. Removing the :8080
from the scripts made sure the requests were sent to the right server.