mirror of
https://github.com/Yanyutin753/RefreshToV1Api.git
synced 2025-10-19 18:03:56 +00:00
[init] 初始化项目
This commit is contained in:
17
upload.py
Normal file
17
upload.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from flask import Flask, send_from_directory
|
||||
import os
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
# 确保 images 文件夹存在
|
||||
os.makedirs('images', exist_ok=True)
|
||||
|
||||
@app.route('/images/<filename>')
|
||||
def get_image(filename):
|
||||
# 检查文件是否存在
|
||||
if not os.path.isfile(os.path.join('images', filename)):
|
||||
return "文件不存在哦!", 404
|
||||
return send_from_directory('images', filename)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0', port=23333)
|
Reference in New Issue
Block a user