-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
23 lines (20 loc) · 754 Bytes
/
main.py
File metadata and controls
23 lines (20 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from flask import Flask, url_for, render_template, send_from_directory, request
import os
from flask_cors import CORS
from app.settings import config
from app.routes import set_routes
app=Flask(__name__, static_url_path='/static')
app.config['CORS_HEADERS'] = 'Content-Type'
CORS(app)
config(app)
set_routes(app)
# heroku requires using env var for port
port = int(os.environ.get("PORT", "5000"))
# actually doesn't run when in docker, and actualy shouldn't (hence why the conditional is there)
if __name__ == "__main__":
# Only for debugging while developing
print("NOW RUNNING!!!!!!!!!!!!!!")
app.run(host='0.0.0.0', debug=True, port=port)
print("started")
else:
print("not running as python script, but from flask run command")