AI 生成: 一个面向个人/团队/家庭的智能旅游规划工具,支持AI行程生成、地图标注与景点打卡记录。
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Travel Planner - Flask 静态服务入口
|
||||
|
||||
运行:
|
||||
pip install flask
|
||||
python app.py
|
||||
然后访问 http://127.0.0.1:5000
|
||||
"""
|
||||
|
||||
from flask import Flask, send_from_directory
|
||||
import os
|
||||
|
||||
app = Flask(__name__, static_folder='.', static_url_path='')
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return send_from_directory('.', 'index.html')
|
||||
|
||||
|
||||
@app.route('/<path:path>')
|
||||
def static_files(path):
|
||||
# 保证静态资源(css/js 等)可访问
|
||||
if os.path.exists(path):
|
||||
return send_from_directory('.', path)
|
||||
return send_from_directory('.', 'index.html')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='127.0.0.1', port=5000, debug=True)
|
||||
Reference in New Issue
Block a user