Started with flask and added a /time endpoint
This commit is contained in:
parent
395b3f1e54
commit
8fd0e44422
5 changed files with 11 additions and 1 deletions
2
backend/.flaskenv
Normal file
2
backend/.flaskenv
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
FLASK_APP=api.py
|
||||||
|
FLASK_ENV=development
|
|
@ -1 +0,0 @@
|
||||||
from __
|
|
8
backend/api.py
Normal file
8
backend/api.py
Normal 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()}
|
|
@ -3,4 +3,5 @@ Flask==1.1.2
|
||||||
itsdangerous==1.1.0
|
itsdangerous==1.1.0
|
||||||
Jinja2==2.11.3
|
Jinja2==2.11.3
|
||||||
MarkupSafe==1.1.1
|
MarkupSafe==1.1.1
|
||||||
|
python-dotenv==0.17.1
|
||||||
Werkzeug==1.0.1
|
Werkzeug==1.0.1
|
||||||
|
|
Loading…
Reference in a new issue