24 lines
639 B
Python
24 lines
639 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
启动地震体 API 模拟服务器
|
|
|
|
启动 mock_seismic_api.py 中定义的 Flask 应用,
|
|
用于在本地端口 5001 上提供模拟的地震体 API 服务。
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# 添加项目根目录到 Python 路径
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
|
|
|
# 导入模拟 API 服务器模块
|
|
from tests.mock_seismic_api import app
|
|
|
|
if __name__ == "__main__":
|
|
print("启动地震体 API 模拟服务器在 http://localhost:5001/")
|
|
print("使用 Ctrl+C 停止服务器")
|
|
app.run(host='0.0.0.0', port=5001, debug=True) |