Started with flask and added a /time endpoint

This commit is contained in:
cami 2021-05-07 02:24:50 +02:00
parent 395b3f1e54
commit 8fd0e44422
5 changed files with 11 additions and 1 deletions

2
backend/.flaskenv Normal file
View file

@ -0,0 +1,2 @@
FLASK_APP=api.py
FLASK_ENV=development

View file

View file

@ -1 +0,0 @@
from __

8
backend/api.py Normal file
View file

@ -0,0 +1,8 @@
import time
from flask import Flask
app = Flask(__name__)
@app.route('/time')
def get_current_time():
return {'time': time.time()}

View file

@ -3,4 +3,5 @@ Flask==1.1.2
itsdangerous==1.1.0
Jinja2==2.11.3
MarkupSafe==1.1.1
python-dotenv==0.17.1
Werkzeug==1.0.1