mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
26 lines
545 B
Python
26 lines
545 B
Python
import sys
|
|
|
|
from bottle import route, run, request, response
|
|
|
|
|
|
@route("/<_bucket>/<_path:path>")
|
|
def server(_bucket, _path):
|
|
result = (
|
|
request.headers["MyCustomHeader"]
|
|
if "MyCustomHeader" in request.headers
|
|
else "unknown"
|
|
)
|
|
response.content_type = "text/plain"
|
|
response.set_header("Content-Length", len(result))
|
|
return result
|
|
|
|
|
|
@route("/")
|
|
def ping():
|
|
response.content_type = "text/plain"
|
|
response.set_header("Content-Length", 2)
|
|
return "OK"
|
|
|
|
|
|
run(host="0.0.0.0", port=int(sys.argv[1]))
|