TelegramAktienBot/api
dependabot[bot] 2900d953e5
Update flask requirement from ~=2.1.0 to ~=2.1.1 in /api
Updates the requirements on [flask](https://github.com/pallets/flask) to permit the latest version.
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/flask/compare/2.1.0...2.1.1)

---
updated-dependencies:
- dependency-name: flask
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-31 10:32:06 +00:00
..
app Fixed test config 2022-03-30 11:11:02 +02:00
deploy Extracted frontend from webservice to new directory 2022-03-17 17:11:00 +01:00
tests Refactoring 2022-03-30 11:10:48 +02:00
.env.example Updated README files, .gitignore and .env.example 2022-03-17 23:49:39 +01:00
app.py Tests 2022-03-30 10:46:54 +02:00
Dockerfile Extracted frontend from webservice to new directory 2022-03-17 17:11:00 +01:00
README.md Update README.md 2022-03-30 10:51:38 +02:00
requirements.txt Update flask requirement from ~=2.1.0 to ~=2.1.1 in /api 2022-03-31 10:32:06 +00:00

API

Aktienbot API

Development

  1. Create virtual environment python -m venv venv env/Scripts/activate
  2. Install requirements pip install -r api/requirements.txt
  3. Set environment variables (see list below)
    1. Use .env-file in api directory like .env.example
    2. Or set variables using export or set commands. (Windows set, Linux export)
  4. Run api python api/app.py

Testing

  1. Create virtual environment python -m venv venv env/Scripts/activate
  2. Install requirements pip install -r api/requirements.txt
  3. Set environment variables (see list below)
    1. Use .env-file in api directory like .env.example
    2. Or set variables using export or set commands. (Windows set, Linux export)
  4. Change directory: cd api/
  5. Run tests: python -m pytest -v --cov-report term-missing --cov=app

Environment variables

    # Flask secret key
    SECRET_KEY=
    
    # MYSQL Connection
    MYSQL_USER=
    MYSQL_PASSWORD=
    MYSQL_HOST=
    MYSQL_PORT=
    MYSQL_DATABASE=

Docker

docker run -d \
    --name aktienbot_api \
    --hostname aktienbot_api \
    --publish 80:80 \
    --env "SECRET_KEY=" \
    --env "MYSQL_USER=" \
    --env "MYSQL_PASSWORD=" \
    --env "MYSQL_HOST=" \
    --env "MYSQL_PORT=" \
    --env "MYSQL_DATABASE=" \
    --restart unless-stopped \
    registry.flokaiser.com/aktienbot/api:latest

or load environment variables from file by using --env-file <filename>