|  | @@ -0,0 +1,36 @@
 | 
											
												
													
														|  | 
 |  | +from flask import Flask
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +from src.settings.settings_manager import settings_manager
 | 
											
												
													
														|  | 
 |  | +from src.logic.start_factory import start_factory
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +setman = settings_manager()
 | 
											
												
													
														|  | 
 |  | +start = None
 | 
											
												
													
														|  | 
 |  | +storage = None
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +app = Flask(__name__)
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +@app.route("/api/export/<storage_key>", methods=["GET"])
 | 
											
												
													
														|  | 
 |  | +def get_export(storage_key: str):
 | 
											
												
													
														|  | 
 |  | +    global setman, start, storage
 | 
											
												
													
														|  | 
 |  | +    if storage_key not in storage.data:
 | 
											
												
													
														|  | 
 |  | +        return "Key not found", 404
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    return app.response_class(
 | 
											
												
													
														|  | 
 |  | +        response="Not implemented",
 | 
											
												
													
														|  | 
 |  | +        status=200,
 | 
											
												
													
														|  | 
 |  | +    )
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +# Инициализация приложения
 | 
											
												
													
														|  | 
 |  | +def run():
 | 
											
												
													
														|  | 
 |  | +    global setman, start, storage
 | 
											
												
													
														|  | 
 |  | +    setman.open("config/settings.json")
 | 
											
												
													
														|  | 
 |  | +    start = start_factory(setman.settings)
 | 
											
												
													
														|  | 
 |  | +    storage = start.storage
 | 
											
												
													
														|  | 
 |  | +    app.run()
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +if __name__ == "__main__":
 | 
											
												
													
														|  | 
 |  | +    run()
 |