forked from Sagarpatel9/malware-scanning-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (30 loc) · 1.08 KB
/
main.py
File metadata and controls
38 lines (30 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
from flask import Flask
from dotenv import load_dotenv
from report import report_bp
from scanresults import scan_bp
from fileupload import upload_bp
# Load env
load_dotenv()
# Tell Flask exactly where to find templates & static files
base_dir = os.path.dirname(os.path.abspath(__file__))
template_path = os.path.join(base_dir, "templates")
static_path = os.path.join(base_dir, "static")
print("🔍 Template path Flask is using:", template_path)
print("📂 Contents of template folder:", os.listdir(template_path))
app = Flask(__name__, template_folder=template_path, static_folder=static_path)
# Register blueprints
app.register_blueprint(report_bp)
app.register_blueprint(scan_bp)
app.register_blueprint(upload_bp)
@app.route('/')
def home():
return '''
<h1>Welcome to My Flask App</h1>
<p>This app connects to BigQuery.</p>
<a href="/report">📄 View Logging Report</a> <br>
<a href="/scanresults">📄 View Scan Results</a> <br>
<a href="/upload">📤 Upload File</a>
'''
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8080)