I run my function through domain and console but still received this kind of error
My function code:
TypeScript
// This is your Appwrite function
// It's executed each time we get a request
export default async ({ req, res, log, error }: any) => {
// Why not try the Appwrite SDK?
const headers = req.headers;
log(JSON.stringify(headers));
// const client = new Client()
// .setEndpoint("https://cloud.appwrite.io/v1")
// .setProject(Bun.env["APPWRITE_FUNCTION_PROJECT_ID"])
// .setKey(headers["DDC_SECRET_KEY"]);
// const databases = new Databases(client);
// // The `req` object contains the request data
// if (req.method === "GET") {
// const response = await databases.getDocument(
// "65a389d70bee25715a29",
// "65a85181f26b3b9f9232",
// headers["taramed-patient-id"]
// );
// return res.json({
// patientInfo: {
// firstName: response["firstName"],
// lastName: response["lastName"],
// dateOfBirth: response["dateOfBirth"],
// gender: response["gender"],
// address: response["address"],
// weight: response["weight"],
// weightUnit: response["weightUnit"],
// },
// vitalSigns: {
// heartRate: response["heartRate"],
// bloodPressure: response["bloodPressure"],
// respiratoryRate: response["respiratoryRate"],
// temperature: response["bodyTemperature"],
// },
// });
// }
// `res.json()` is a handy helper for sending JSON
return res.json({
motto: "Build like a team of hundreds_",
learn: "https://appwrite.io/docs",
connect: "https://appwrite.io/discord",
getInspired: "https://builtwith.appwrite.io",
});
};
TL;DR
The developer received an error when running their function through a domain and console. They shared their function code which includes commented out sections. They were trying to use the Appwrite SDK and make a GET request to retrieve data from a database, but the code is currently commented out. In the end, they are returning a JSON response with some key-value pairs. There is no solution mentioned in the thread.[SOLVED]
What happened?
Recommended threads
- Appwrite Cloud project is paused and nev...
Hi Appwrite Team & Community, I am facing a problem with one of my Appwrite Cloud projects which seems to be identical to the other cases of "paused projects" ...
- Timed out waiting for runtime error
execution id 6a3e0791978712d81ee0 im having issue with appwrite function runtime performance. even after 4gbram and cpu same function sometimes completes in a...
- Project auto-blocked after load testing ...
Hi team π My project has been automatically blocked with the message: "Project is currently blocked β Access to this project is restricted. Contact support if...