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
- dynamic key missing scopes for database ...
Here are the scopes listed, I get permission errors for reading row and document. Appears to be missing since last time i checked. Database 6 Scopes policies....
- Worker functions stuck on "Fetched 0 fun...
Appwrite Version: 1.9.0 Bug Description: The appwrite-worker-functions container gets stuck in an infinite loop logging "Fetched 0 functions..." while scheduled...
- I am using s3 for app storage but is it ...
_APP_STORAGE_DEVICE=s3 puts everything to the s3 storage but i need to be able to keep the function builds and site in the local and not waste the cloud storage...