usin "appwrite": "^10.0.1"
server sdk looks:
import { Client } from 'node-appwrite';
import { fetch } from 'undici';
export default async ({ req, res, log, error }) => {
// If something goes wrong, log an error
error('Hello, Errors!');
if (req.path === '/eur') {
const amountInEuros = Number(req.query.amount);
const response = await fetch('https://api.exchangerate.host/latest?base=EUR&symbols=USD');
const data = await response.json();
const amountInDollars = amountInEuros * data.rates.USD;
return res.send(amountInDollars.toString());
}
if (req.path === '/inr') {
const amountInRupees = Number(req.query.amount);
const response = await fetch('https://api.exchangerate.host/latest?base=INR&symbols=USD');
const data = await response.json();
const amountInDollars = amountInRupees * data.rates.USD;
return res.send(amountInDollars.toString());
}
return res.send('Invalid path');
};
Mouse over createExecution. What do you see?
That's weird and confusing...that's for the code in the same folder as the package.json that says 10.0.1?
Yes
For some reason, your IDE isn't picking up the right types.
This version is old. Please upgrade
Which Version should work
Always read the readme to see what version of Appwrite the SDK version is for
Recommended threads
- ClientException with SocketException: Cl...
hi <@564158268319203348> i have noticed this 500 status code in my function requests, it seems its not able to connect to the internet in the function as reque...
- NEW ERROR Invalid document structure: At...
Error: ```AppwriteException: document_invalid_structure, Invalid document structure: Attribute "pb.kmsgxPkgInfo.id_info" must be an array (400)``` I’m encounter...
- Issues with executor in Appwrite 1.9.0
Hi, I’ve recently did a fresh install of appwrite 1.9.0 self hosted and when I run a function, it just waits indefinite This is the error from the log: [Er...