Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- def api1(start_response):
- starttime = time.strftime("%H:%M:%S")
- time.sleep(10)
- endtime = time.strftime("%H:%M:%S")
- start_response("200 OK", [("Content-type", "text/plain")])
- return "api1: " + starttime + " - " + endtime
- def api2(start_response):
- starttime = time.strftime("%H:%M:%S")
- time.sleep(10)
- endtime = time.strftime("%H:%M:%S")
- start_response("200 OK", [("Content-type", "text/plain")])
- return "api2: " + starttime + " - " + endtime
- def application(environ, start_response):
- path = environ["PATH_INFO"]
- if path == "/api1":
- return api1(start_response)
- elif path == "/api2":
- return api2(start_response)
- [uwsgi]
- processes = 3
- threads = 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement