Skip to content

Commit 374d16e

Browse files
committed
flask1
1 parent f8c59cd commit 374d16e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

4_1.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from flask import Flask #웹 어플리케이션 만드는 프레임 워크 flask
2+
3+
#앱을 만들기 위한 코드
4+
app = Flask("SuperScrapper")
5+
6+
# @ = decorator...바로 아래에 있는 "함수"를 찾아서 decorate 해준다.
7+
# / 로 접속요청 시 파이썬 함수를 실행하도록 구축
8+
@app.route("/")
9+
def home():
10+
return "Hello! welcome to my house"
11+
12+
# url 끝에 /contact 를 붙여서 접속하면 아래 함수 실행
13+
@app.route("/contact")
14+
def home2():
15+
return "Hello! nice contact"
16+
17+
18+
19+
#repl.it 에서 구동하는 서버
20+
app.run(host="0.0.0.0")
21+

0 commit comments

Comments
 (0)