0

I have created an API with flask and I'm trying to use Postman to test it, I think I'm not using the correct request URL.

On postman I am sending a GET request to the public DNS of my EC2 instance ec2-1-1-111-10.eu-west-2.compute.amazonaws.com/

My flask endpoint looks like this

from flask import Flask

application = Flask(__name__)

@application.route("/")
def hello():
    return "<h1 style='color:blue'>Hello There!</h1>"

if __name__ == '__main__':
    application.run(host="0.0.0.0", port="8080")

Sending a request to http://localhost:8080/ works fine but when trying to make a request to my app running on EC2 postman just hangs waiting for a response

I am unable to choose a port number other than 80

So I managed to get a response using 0.0.0.0/0 as my source but I would like to allow only requests from a particular IP, my IPv4 does not have a slash in what should I put there 0.0.0.0/??? enter image description here

davidism
  • 98,508
  • 22
  • 317
  • 288

1 Answers1

0

Chances are that port hasn't been forwarded you can look how to do that here

  • I think you are correct but when I choose HTTP as the request type it will only let me use port 80, however setting my application to use port 80 gives a permission denied error when trying to run my Flask app –  Mar 21 '19 at 11:14
  • 1
    You can choose a custom port in the drop down – Jordan Robinson Mar 21 '19 at 11:17