You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.8 KiB
36 lines
1.8 KiB
from flask import Flask, jsonify, send_from_directory
|
|
|
|
app = Flask(__name__, static_folder="public", static_url_path="")
|
|
|
|
# 根路径返回 index.html
|
|
@app.route("/")
|
|
def serve_index():
|
|
return send_from_directory(app.static_folder, "index.html")
|
|
|
|
# API 子路径,提供菏泽宣传数据
|
|
@app.route("/api/heze")
|
|
def api_heze():
|
|
heze_data = {
|
|
"message": "欢迎来到山东菏泽",
|
|
"data": {
|
|
"about": "菏泽是中国牡丹之都,位于山东省西南部,以其丰富的历史文化和美丽的自然景观而闻名。",
|
|
"places": [
|
|
{"name": "曹州牡丹园", "description": "世界上最大的牡丹园,每年春季举办牡丹花会,吸引众多游客。"},
|
|
{"name": "孙膑旅游城", "description": "以古代军事家孙膑为主题的文化旅游区,展示了丰富的历史遗迹。"},
|
|
{"name": "水浒好汉城", "description": "以《水浒传》为背景的文化景区,重现了宋朝时期的建筑和民俗。"}
|
|
],
|
|
"food": [
|
|
{"name": "菏泽酱菜", "description": "菏泽特色酱菜,口感爽脆,风味独特。"},
|
|
{"name": "曹州烧饼", "description": "菏泽传统小吃,外皮酥脆,内馅丰富。"},
|
|
{"name": "牡丹饼", "description": "以牡丹花瓣为原料制作的特色糕点,香气扑鼻。"}
|
|
],
|
|
"culture": [
|
|
{"name": "菏泽戏曲", "description": "菏泽是山东梆子、大平调等多种戏曲的发源地,戏曲文化丰富多彩。"},
|
|
{"name": "菏泽剪纸", "description": "菏泽剪纸是中国非物质文化遗产之一,技艺精湛,图案精美。"}
|
|
]
|
|
}
|
|
}
|
|
return jsonify(heze_data)
|
|
|
|
if __name__ == "__main__":
|
|
app.run(debug=True, host="0.0.0.0",port=80)
|