title: passing arguments to API created by flask in python
body: <p>I am a complete newbie to API and python. actually, after getting disappointed to find a free host supporting plumber in R I decided to try it by python. The simple problem is that I have a simple function which takes two numeric arguments and using a given CSV file do some calculations and returns a number (I have simply made this in R by the plumber in localhost). now for a test in python have written below code:</p>
  
  <pre><code>from flask import Flask
  
  app = Flask(__name__)
  
  @app.route("/")
  def hello():
      return "hello world!"
  
  if __name__ == '__main__':
      app.run(debug=True)
  </code></pre>
  
  <p>well, this correctly works. but when I try to make a function to take arguments like this:</p>
  
  <pre><code>from flask import Flask
  
  app = Flask(__name__)
  
  @app.route("/")
  def hello(a):
      return a + 2
  
  if __name__ == '__main__':
      app.run(debug=True)
  </code></pre>
  
  <p>I get this page which says I have not passed the arguments.</p>
  
  <p><a href="https://i.stack.imgur.com/jj5by.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jj5by.jpg" alt="enter image description here"></a></p>
  
  <p>my main question is that how I can pass the arguments? (in API created by R plumber, for example, I call it like: <code>localhost/5000/?a=2</code> )</p>
  
  <p>my another question is, could be this kind of API host and request in something like Heroku?</p>