-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapp2.py
More file actions
35 lines (27 loc) · 646 Bytes
/
Copy pathapp2.py
File metadata and controls
35 lines (27 loc) · 646 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
27
28
29
30
31
32
33
34
35
# import packages
from flask import Flask
# create app
myapp = Flask(__name__)
# develop api
@myapp.route("/")
def hello():
return "I am happy to say hello"
# develop api
@myapp.route("/mukund")
def greet():
return "ok"
# develop api
@myapp.route("/ishita")
def welcome():
return "I am happy to say hello"
# develop api
@myapp.route("/<name>")
def namaste(name):
return "hello, sir " + name
# develop api
@myapp.route("/<name>/<city>")
def my_client(name, city):
return "hello, sir " + name + "when did you come from " + city
# run app
if __name__ == "__main__":
myapp.run(host="127.0.0.1", port=8082, debug=False)