-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
26 lines (18 loc) · 678 Bytes
/
app.py
File metadata and controls
26 lines (18 loc) · 678 Bytes
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
from flask import Flask, render_template, request, send_file, send_from_directory
app = Flask(__name__)
links = {
"github": "https://github.com/sebbycat",
"facebook": "https://www.facebook.com/yuming.long.9",
"linkedin": "https://www.linkedin.com/in/yuming-long/"
}
@app.route('/', methods=["GET", "POST"])
def index():
if request.method == "POST" :
return send_file("./pdf/resume.pdf", attachment_filename="resume.pdf", as_attachment=True)
else:
return render_template("index.html", links=links)
@app.route('/<name>')
def index1(name):
return "hello, world " + name
if __name__ == '__main__' :
app.run(debug = True ,host ='0.0.0.0')