A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/wizardofzos/aoc2021 below:

GitHub - wizardofzos/aoc2021: Advent of Code 2021

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 activate <env-that-has-python3-in-it>
git clone git@github.com: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...

Adding endpoints to the REST-API

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 :)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4