aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docs/api
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2023-11-03 21:13:33 +0800
committer简律纯 <i@jyunko.cn>2023-11-03 21:13:33 +0800
commit9f0d43fe099a95ab1516ae951dcb60a89e76a5a5 (patch)
tree51614fe47bff8bb11028a07d4a35c34c9ff6594a /docs/api
parent8f135707d069c900e055dae71e69909d6b9a41bb (diff)
downloadHydroRoll-9f0d43fe099a95ab1516ae951dcb60a89e76a5a5.tar.gz
HydroRoll-9f0d43fe099a95ab1516ae951dcb60a89e76a5a5.zip
chore: delete useless codes
Diffstat (limited to 'docs/api')
-rw-r--r--docs/api/index.py9
-rw-r--r--docs/api/roots.py24
2 files changed, 0 insertions, 33 deletions
diff --git a/docs/api/index.py b/docs/api/index.py
deleted file mode 100644
index 28bff7d..0000000
--- a/docs/api/index.py
+++ /dev/null
@@ -1,9 +0,0 @@
-from sanic import Sanic
-from sanic.response import json
-app = Sanic()
-
-
-@app.route('/')
-@app.route('/<path:path>')
-async def index(request, path=""):
- return json({'hello': path})
diff --git a/docs/api/roots.py b/docs/api/roots.py
deleted file mode 100644
index 428c625..0000000
--- a/docs/api/roots.py
+++ /dev/null
@@ -1,24 +0,0 @@
-import json
-import random
-from http.server import BaseHTTPRequestHandler
-from os.path import dirname, abspath, join
-from typing import Any
-
-dir = dirname(abspath(__file__))
-
-class handler(BaseHTTPRequestHandler):
- def do_GET(self):
- self.send_response(200)
- self.send_header('Content-type', 'application/json')
- self.end_headers()
-
- with open(join(dir, '..', 'data', 'roots.txt'), 'r', encoding='utf-8') as file:
- lines = file.readlines()
- random_line = random.choice(lines)
- response = {
- 'line': random_line.strip()
- }
- response_json = json.dumps(response, ensure_ascii=False)
-
- self.wfile.write(response_json.encode('utf-8'))
- return \ No newline at end of file