/
osbornray
/
PythonHacks
Обзор
Документация
Войти
/
osbornray
/
PythonHacks
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
AWS_ECS_Labs/app.py
32 строки
680 B
RekhuGopal
ECS Labs
18 сен 2023, 10:43
18 сен 2023, 10:43
be56c7e
Код
Авторство
О чём код?
from flask import Flask import random import time app = Flask(__name__) @app.route('/time') def get_current_time(): timestamp = str(int(time.time())) response = { "time": timestamp, "message": "success", "httpsresponse": "200", "testedTIME": "yes" } return response ## Add a new route here @app.route('/random') def get_random_numbers(): numbers = [random.randint(0, 5) for _ in range(10)] response = { "random_number": numbers, "message": "success", "httpsresponse": "200", "testedTIME": "yes" } return response if __name__ == '__main__': app.run(host='0.0.0.0', port=5000)