from flask import Flask, jsonify, send_from_directory
import os
 
app = Flask(__name__)
BASE_DIR = '/mnt/wddisk/www/html'
 
@app.route('/')
def index():
    return "Welcome to the Mirror API!"
 
@app.route('/api/files/<path:filename>')
def get_file(filename):
    return send_from_directory(os.path.join(BASE_DIR, 'repo'), filename)
 
if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8008)  # 在生产环境中，应使用 WSGI 服务器如 Gunicorn 或 uWSGI，而非 app.run()。