MCPcopy Create free account
hub / github.com/Azure/static-web-apps-cli / main

Function main

e2e/samples/api/python/hello/__init__.py:6–24  ·  view source on GitHub ↗
(req: func.HttpRequest)

Source from the content-addressed store, hash-verified

4
5
6def main(req: func.HttpRequest) -> func.HttpResponse:
7 logging.info('Python HTTP trigger function processed a request.')
8
9 name = req.params.get('name')
10 if not name:
11 try:
12 req_body = req.get_json()
13 except ValueError:
14 pass
15 else:
16 name = req_body.get('name')
17
18 if name:
19 return func.HttpResponse(f"Hello, {name}. This HTTP triggered function executed successfully.")
20 else:
21 return func.HttpResponse(
22 "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.",
23 status_code=200
24 )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…