1
0
Fork 0
mirror of synced 2024-08-31 09:51:33 +12:00
appwrite/tests/resources/functions/python/main.py

21 lines
1.2 KiB
Python
Raw Normal View History

2022-02-24 03:39:09 +13:00
import json
2023-08-19 20:05:49 +12:00
import os
2022-02-24 03:39:09 +13:00
2023-08-19 20:05:49 +12:00
def main(context):
context.log('Amazing Function Log')
2022-02-24 03:39:09 +13:00
2023-08-19 20:05:49 +12:00
return context.res.json({
'APPWRITE_FUNCTION_ID' : os.environ.get('APPWRITE_FUNCTION_ID',''),
'APPWRITE_FUNCTION_NAME' : os.environ.get('APPWRITE_FUNCTION_NAME',''),
'APPWRITE_FUNCTION_DEPLOYMENT' : os.environ.get('APPWRITE_FUNCTION_DEPLOYMENT',''),
'APPWRITE_FUNCTION_TRIGGER' : context.req.headers.get('x-appwrite-trigger', ''),
'APPWRITE_FUNCTION_RUNTIME_NAME' : os.environ.get('APPWRITE_FUNCTION_RUNTIME_NAME',''),
'APPWRITE_FUNCTION_RUNTIME_VERSION' : os.environ.get('APPWRITE_FUNCTION_RUNTIME_VERSION',''),
'APPWRITE_FUNCTION_EVENT' : context.req.headers.get('x-appwrite-event', ''),
'APPWRITE_FUNCTION_EVENT_DATA' : context.req.body_raw,
'APPWRITE_FUNCTION_DATA' : context.req.body_raw,
'APPWRITE_FUNCTION_USER_ID' : context.req.headers.get('x-appwrite-user-id', ''),
'APPWRITE_FUNCTION_JWT' : context.req.headers.get('x-appwrite-user-jwt', ''),
'APPWRITE_FUNCTION_PROJECT_ID' : os.environ.get('APPWRITE_FUNCTION_PROJECT_ID',''),
'CUSTOM_VARIABLE' : os.environ.get('CUSTOM_VARIABLE',''),
2022-02-24 03:39:09 +13:00
})