Files
website/utils/fix_routes.py

10 lines
894 B
Python
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import re
import shutil
shutil.copy('app.py', 'app.py.backup')
with open('app.py', 'r', encoding='utf-8') as file:
content = file.read()
content = content.replace('@app.route(\'/api/mindmap/<node_id>\')', '# GENERISCHE ROUTE - SOLLTE NACH DER ROOT-ROUTE KOMMEN\n@app.route(\'/api/mindmap/<node_id>\')')
with open('app.py', 'w', encoding='utf-8') as file:
file.write(content)
print('Reihenfolge der Routen erfolgreich markiert!')