-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
63 lines (60 loc) · 1.19 KB
/
main.py
File metadata and controls
63 lines (60 loc) · 1.19 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# from flusk import app
#
#
# @app.route('/hello')
# def hello():
# return 'Hello!!!!!!!!!!!'
#
# app.run_server('127.0.0.1', 8008)
# import datetime
# import random
#
# from flask import Flask, request, Response
#
# from utils import parse_length
#
# app = Flask(__name__)
#
# @app.route('/')
# def hello_world():
# return 'Hello, World!'
#
#
# @app.route('/now')
# def get_now():
# result = str(datetime.datetime.now())
# return result
#
#
# # def parse_length(request, default=10):
# # value = request.args.get('length', str(default))
# #
# # if not value.isnumeric():
# # raise ValueError('Not a number')
# #
# # value = int(value)
# # if not 3 < value < 100:
# # raise ValueError('Out of range')
# #
# # return value
#
#
# @app.route('/random')
# def get_random():
# try:
# length = parse_length(request, 10)
# except Exception as ex:
# return Response(ex, status=400)
#
# try:
# result = ''.join([
# str(random.randint(0, 9))
# for _ in range(length)
# ])
# except Exception as ex:
# return Response(ex, status=500)
#
# return result
#
#
# app.run('127.0.0.1', 8009, debug=True)