Based on https://github.com/wizardofzos/flask-rest-zos/
Repo for my solutions to AOC2021. More info: https://adventofcode.com/2021 Wanted to have some extra practice on flask-rest and also do some REXX.
So I've made this REST API that either runs python code, or REXX and shows the result...
- Conda installed
- Python available
- Network connectivity to the outside world
conda activate <env-that-has-python3-in-it>
git clone [email protected]:wizardofzos/flask-rest-zos.git
cd flask-rest-zos
python -m venv .
. bin/activate
python3 -m pip install -r requirements.txt
conda activate <env-that-has-python3-in-it>
cd ../../flask-rest-zos
. bin/activate
# Optional if you want another port than 12345
export PORT=<port-you-want>
python3 aoc2021.py
Then point your browser to http://<ip_or_dns_of_your_mainframe>:12345/swagger-ui and...
Every endpoint has it's own file in /endpoints. Make sure to add your new endpoints to /endpoints/init.py with a line like so:
from .<name-of-your-resource-endpoint.py> import <ResourceName>
Then in test-app.py add these lines:
from endpoints import <ResourceName>
api.add_resource(<ResourceName>, '/<path-to-your-new-endpoint')
docs.register(<ResourceName>)
And off you go :)
Write how to add new solutions :)