Skip to content

Commit

Permalink
chore(python/starter): rename ctx to context
Browse files Browse the repository at this point in the history
  • Loading branch information
loks0n committed Jul 20, 2023
1 parent fb98ddb commit 968cc30
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/starter-template/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# This is your Appwrite function
# It's executed each time we get a request
def main(ctx):
def main(context):
# Why not try the Appwrite SDK?
#
# client = (
Expand All @@ -15,19 +15,19 @@ def main(ctx):
# )

# You can log messages to the console
ctx.log("Hello, Logs! πŸ‘‹")
context.log("Hello, Logs! πŸ‘‹")

# If something goes wrong, log an error
ctx.error("Hello, Errors! β›”")
context.error("Hello, Errors! β›”")

# The `ctx.req` object contains the request data
if ctx.req.method == "GET":
if context.req.method == "GET":
# Send a response with the res object helpers
# `ctx.res.send()` dispatches a string back to the client
return ctx.res.send("Hello, World! 🌎")
return context.res.send("Hello, World! 🌎")

# `ctx.res.json()` is a handy helper for sending JSON
return ctx.res.json(
return context.res.json(
{
"motto": "Build Fast. Scale Big. All in One Place.",
"learn": "https://appwrite.io/docs",
Expand Down

0 comments on commit 968cc30

Please sign in to comment.