title: How can I have my flask-app run on my sites subdomain?
body: <p>For example, I want to run flask-app on <a href="http://api.domain.com" rel="nofollow noreferrer">http://api.domain.com</a> . However, I have no idea how to do this and the flask documentation serves no help. I am using a shared namecheap web server via SSH to run python. I have ports 8080, 8181 and 8282 open. </p>
  
  <p>Server-sided code:</p>
  
  <pre><code>from flask import Flask
  from flask import Blueprint
  
  app = Flask(__name__)
  app.config['SERVER_NAME'] = 'domain.com'
  
  @app.route('/status')
  def status():
     return 'Status : Online'
  
  bp = Blueprint('subdomain', __name__, subdomain="api")
  
  app.register_blueprint(bp)
  
  if __name__ == '__main__':
     app.run(host=app.config["SERVER_NAME"],port=8181,debug=True)
  </code></pre>
  
  <p>When I visit <a href="http://www.api.domain.com/status" rel="nofollow noreferrer">http://www.api.domain.com/status</a> , it returns a 404 error. 
  Nothing displays on the SSH console. </p>
  
  <p>Any help if very much appreciated. </p>