chore: sync local changes to Gitea

This commit is contained in:
shumengya
2026-06-24 22:10:25 +08:00
parent cc4326140b
commit d678c25cfb
2 changed files with 88 additions and 1 deletions

87
api-docs/geoip-api.json Normal file
View File

@@ -0,0 +1,87 @@
{
"info": {
"name": "geoip-api",
"_postman_id": "c4f8a1e2-9b7d-4e3c-a1f0-2d8e6b4c9a10",
"description": "Postman Collection v2.1 — Cloudflare Workers 访客公网 IP 与 `request.cf` 地理/网络信息。\n\n导入Postman「Import」或 Apifox「导入」→ Postman 格式。\n仅使用集合变量 `baseUrl`(默认生产),不附带环境文件,避免与环境变量叠用冲突。\n`GET /api`、`/ipv4`、`/ipv6` 可查 `pretty=1` 美化 JSON。",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"variable": [
{
"key": "baseUrl",
"value": "https://geoip.api.smyhub.com",
"type": "string"
}
],
"item": [
{
"name": "page",
"item": [
{
"name": "GET /",
"request": {
"method": "GET",
"header": [],
"url": "{{baseUrl}}/",
"description": "首页 HTML含 `/api?pretty=1` 示例脚本)。"
},
"response": []
}
]
},
{
"name": "api",
"item": [
{
"name": "GET /api",
"request": {
"method": "GET",
"header": [],
"url": "{{baseUrl}}/api",
"description": "JSON`ip`、`ipVersion`、`userAgent`、`geo`、`network`、`ts`。"
},
"response": []
},
{
"name": "GET /api?pretty=1",
"request": {
"method": "GET",
"header": [],
"url": "{{baseUrl}}/api?pretty=1",
"description": "同上,缩进格式化输出。"
},
"response": []
},
{
"name": "GET /ipv4",
"request": {
"method": "GET",
"header": [],
"url": "{{baseUrl}}/ipv4",
"description": "仅当连接经 IPv4 到达边缘时 `ok: true`,否则 400。可 `?pretty=1`。"
},
"response": []
},
{
"name": "GET /ipv6",
"request": {
"method": "GET",
"header": [],
"url": "{{baseUrl}}/ipv6",
"description": "仅当连接经 IPv6 到达边缘时 `ok: true`,否则 400。可 `?pretty=1`。"
},
"response": []
},
{
"name": "OPTIONS /api",
"request": {
"method": "OPTIONS",
"header": [],
"url": "{{baseUrl}}/api",
"description": "CORS 预检;响应 204 + `Access-Control-*`。"
},
"response": []
}
]
}
]
}

View File

@@ -1,3 +1,3 @@
name = "cf-ip-geo"
name = "geoip-api"
main = "worker.js"
compatibility_date = "2026-03-05"