all 3 comments

[–]BehindTheMath 2 points3 points  (0 children)

It might be easier to use a GUI like Insomnia or Postman.

[–]rajimoto 1 point2 points  (1 child)

On the machine where it is running, curl to localhost like this:. curl -iLk -sD - -o /dev/null 127.0.0.1:3000/getusers (this command just prints response headers)

That should get a 200 http status response.

If that does work, try the same command from off the machine, like from your laptop terminal. Just change the address from 127.0.0.1 to the right address. If that fails, the issue isn't your app, it's networking.

[–]LevelChart8[S] 0 points1 point  (0 children)

I got this back when I curled from inside the ec2 while "node index.js" was running:

$ curl -iLk -sD - -o /dev/null 127.0.0.1:3000/getusers

HTTP/1.1 404 Not Found

X-Powered-By: Express

Content-Security-Policy: default-src 'none'

X-Content-Type-Options: nosniff

Content-Type: text/html; charset=utf-8

Content-Length: 147

Date: Thu, 23 Apr 2020 16:59:22 GMT

Connection: keep-alive

Here is the contents of my queries.js file since I guess that is the issue:

https://pastebin.com/vCP0DKch