MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / do_GET

Method do_GET

examples/bring-your-own-container/app.py:22–31  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

20
21class Handler(BaseHTTPRequestHandler):
22 def do_GET(self):
23 if self.path == "/health":
24 self._json(200, {"status": "ok"})
25 elif self.path == "/hello":
26 self._json(200, {"message": "hello from OpenShell sandbox!"})
27 elif self.path.startswith("/hello/"):
28 name = self.path[len("/hello/") :]
29 self._json(200, {"message": f"hello, {name}!"})
30 else:
31 self._json(404, {"error": "not found"})
32
33 def _json(self, code, body):
34 payload = json.dumps(body).encode()

Callers

nothing calls this directly

Calls 1

_jsonMethod · 0.95

Tested by

no test coverage detected