api_v1.4/hub_api/uptime.py
guille 1adfe6519f Merge remote-tracking branch 'origin/city_commands' into api_guille
# Conflicts:
#	bootstrap.py
#	hub_api/city_commands.py
#	hub_api/config.py
#	hub_api/construction_catalog.py
#	hub_api/energy_demand.py
#	hub_api/greenery_catalog.py
#	hub_api/uptime.py
#	hub_api/user.py
#	requirements.txt
2023-02-13 07:15:10 -05:00

25 lines
551 B
Python

"""
Uptime
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Project Author name guillermo.gutierrezmorote@concordia.ca
"""
import datetime
import json
from flask import Response
from flask_restful import Resource
import hub_api.helpers.session_helper as sh
headers = {'Content-Type': 'application/json'}
class Uptime(Resource):
def __init__(self):
pass
@staticmethod
def get():
uptime = {"uptime": f"{datetime.datetime.now() - sh.begin_time}"}
return Response(response=json.dumps(uptime), headers=headers)