Merge pull request 'hotfix/backendcontainer' (#36) from hotfix/backendcontainer into main

Reviewed-on: #36

Fixes #34
This commit is contained in:
cami 2021-06-22 00:27:07 +00:00
commit 8e77306c93
5 changed files with 40 additions and 4 deletions

View file

@ -1,6 +1,6 @@
FROM python
WORKDIR /opt/
WORKDIR /app
COPY requirements.txt .

View file

@ -1,11 +1,26 @@
blinker==1.4
click==7.1.2
Deprecated==1.2.12
Flask==1.1.2
flask-buzz==0.1.15
Flask-Cors==3.0.10
Flask-Login==0.5.0
Flask-Mail==0.9.1
flask-praetorian==1.2.0
Flask-SQLAlchemy==2.5.1
greenlet==1.1.0
inflection==0.3.1
itsdangerous==1.1.0
Jinja2==2.11.3
MarkupSafe==1.1.1
passlib==1.7.4
pendulum==2.1.2
py-buzz==1.0.3
PyJWT==2.1.0
python-dateutil==2.8.1
python-dotenv==0.17.1
pytzdata==2020.1
six==1.16.0
SQLAlchemy==1.4.15
Werkzeug==1.0.1
wrapt==1.12.1

View file

@ -1,5 +1,8 @@
import time
from flask import Flask
import flask_sqlalchemy
import flask_praetorian
import flask_cors
import os
@ -20,6 +23,16 @@ else:
port = 5000
db = flask_sqlalchemy.SQLAlchemy()
guard = flask_praetorian.Praetorian()
cors = flask_cors.CORS()
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.Text, unique=True)
password = db.Column(db.Text)
@app.route('/')
def home():

View file

@ -20,7 +20,7 @@ services:
dockerfile: Dockerfile
tty: true
volumes:
- ./backend:/usr/src/app/
- ./backend/src:/app/
ports:
- 5000:5000
environment:

View file

@ -1,11 +1,19 @@
import React from "react";
import React, {useState, useEffect} from "react";
import "../../App.css";
import Footer from "../../Footer";
export default function Manual() {
const [currentTime, setCurrentTime] = useState(0);
useEffect(() => {
fetch('/time').then(res => res.json()).then(data => {
setCurrentTime(data.time);
});
}, []);
return (
<>
<h2 className="about">Anleitung / Bedienungshinweise</h2>
<h2 className="about">Anleitung / Bedienungshinweise {currentTime}</h2>
<Footer />
</>
);