POSTMAN,EC2 IMAGESI’ve created a simple API in node and deployed it on an ubuntu based EC2 instance. I also installed node js on my EC2. I’ve been trying to send a POST request from POSTMAN, with a JSON file. My API will extract the required data from the received POST request and will store it on a Mongo Atlas server. I copied my private IP address of EC2 instance and used it in POSTMAN. All I could get is a ‘session timed out’ message on POSTMAN.
I just need to be able to send a POST request to my EC2 instance.
2
Answers
inbound-rules-picture-1Here's my server code-
inbound rules-picture-2
inbound rules
For your EC2 instance to be able to receive HTTP requests from the Internet:
0.0.0.0/0
(or, for testing purposes, just the public IP address associated with your own computer — use https://icanhazip.com/)If it still isn’t working, try connecting to the EC2 instance and do a
curl localhost
to confirm that the web server is working.