How to use Digital ocean serverless functions
PHP serverless functions
click on php name in Namespaces
write php code here
click on the settings tab
get and post curl request from here
get request
curl -X GET "https://faas-blr1-8177d592.doserverless.co/api/v1/web/fn-68b76ca6-8fbb-40fc-bfd2-0343423423d84/default/demo" \
-H "Content-Type: application/json"
to protect the API endpoint you should use a post-curl request
curl -X POST "https://faas-blr1-8177d592.doserverless.co/api/v1/namespaces/fn-5dce8d49-a2ff-4a18-805f-503fghhh97a/actions/api?blocking=true&result=true" \
-H "Content-Type: application/json" \
-H "Authorization: Basic NTM0NDMwZmItZDZmNi00MWZkLTgyMGUtODc2MzE1ZDJmMTQ1OldMU2tQUm1qMFVWeEozS0VieTdjTHY4S3RtUEU5dDJ6bEg4ZGl5Qk0yeTdXbXlRaWtGSm5sQmEyTE1pUnZ0cVY=" \
-d '{"name": "donn"}'