Skip to content

Commit d3b5e68

Browse files
committed
vercel-running
1 parent f2d0d1d commit d3b5e68

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

app/index.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from flask import Flask, render_template, request
2+
from app.complexity import get_complexity_analysis
3+
4+
app = Flask(__name__)
5+
6+
@app.route('/', methods=['GET', 'POST'])
7+
def index():
8+
complexity = None
9+
10+
if request.method == 'POST':
11+
code = request.form['code']
12+
complexity = get_complexity_analysis(code)
13+
14+
print(complexity)
15+
16+
return render_template('index.html', complexity=complexity)
17+
18+
@app.route('/stars')
19+
def hall_of_fame():
20+
return render_template('stars.html')
21+
22+
if __name__ == '__main__':
23+
app.run()

vercel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"rewrites": [
3-
{ "source": "/(.*)", "destination": "run" }
3+
{ "source": "/(.*)", "destination": "app/index" }
44
]
55
}

0 commit comments

Comments
 (0)