diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d0a3a7d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,25 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Flask", + "type": "python", + "request": "launch", + "module": "flask", + "env": { + "FLASK_APP": "BreCal", + "FLASK_DEBUG": "1" + }, + "args": [ + "run", + "--no-debugger", + "--no-reload" + ], + "jinja": true, + "justMyCode": true + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 750e0ae..ea15ea3 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,8 @@ Projekt zur verbesserten Kommunikation der maritimen Partner bei Schiffsanläufe ## Requirements +## Development + +Zum Debuggen der Flask App verwende ich dieses Tutorial: +https://code.visualstudio.com/docs/python/tutorial-flask#_create-a-project-environment-for-the-flask-tutorial diff --git a/docs/export_flask_project.png b/docs/export_flask_project.png new file mode 100644 index 0000000..3736248 Binary files /dev/null and b/docs/export_flask_project.png differ diff --git a/src/server/README.md b/src/server/README.md index 64c3cbc..e422856 100644 --- a/src/server/README.md +++ b/src/server/README.md @@ -2,13 +2,21 @@ ## OpenAPI 3.0 Generated Flask project -All the routes are defined in 'project/api' folder. +The code was originally created by exporting the API from Postman. Selecting the API on the left (root element) the code generation icon becomes visible on the right. + +![image](../../docs/export_flask_project.png) + +If the API gets updated I think it makes most sense to export again into a API helper branch and then merge this branch back into the project. Please do not forget to update the [index.yaml](../../misc/index.yaml) file. +The branch is named yaml_export. + +All the routes are defined in 'project/api' folder. Each route parses the request and calls the corresponding function in the 'project/impl' directory passing all the parameters and request body as function arguments. To run this project: -``` + +```bash pip install -r requirements.txt export FLASK_APP='BreCal' export FLASK_ENV=development flask run -``` \ No newline at end of file +```