Get and Post request 404 error

I’m sorry, to clarify, should I change the get request in my server to be like

get(‘’, (req, res) => { etc insetad of /data since it redirects it there?

I tested this but it doesn’t seem to work so that’s why I’m checking.

And I have the app.listen configured to run on port 8000 as you can see in the post before, but when I put in the search bar the address, it is looking at port 80.

Because 80 is the default http port (and 443 the default https port.)

If you run

% curl -i
HTTP/1.1 404 Not Found
X-Powered-By: Express

the response is served by Express.

If you run

% curl -i
HTTP/1.1 200 OK
Date: Fri, 14 Oct 2022 23:27:11 GMT
Server: Apache/2.4.41 (Ubuntu)

the response is served by Apache.

This means requests are getting through to your server script. You just need to ensure the path configuration is correct.

Netlify won’t however connect to any port other than 80 or 443 with a rewrite/proxy, so running the server on port 8000 is not an option here.

I can now see the connection

And I updated the redirect file to match this new address and the connection works now. Thank you so much for the help

Since this is the redirect that worked for my data, I attempted the same for my post request for sending emails, but that URL still seems to expect a GET request

The fetch did work before on local host so I don’t think it’s an issue with the JS

And it worked before with the server.js, so I assume it’s another redirection error, but I set it up in the same way the data worked so that’s why I’m confused.


It just gives me a 404

As it says “the server responded with 404”, this is again as issue with the server, not with Netlify.

This is not something I can help with, especially as I don’t have access to the code you are using—debugging from screenshots won’t work here.

I figured out the issue with the server, I needed an axios request. Sorry for asking for unrelated help. But now my website is functional. Thank you for all the help, I greatly appreciate it.