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
- Function's Static IP
Is it possible to have static. IP Address instead of Dynamic IP for getting the IP Address whitelist
- How to use dart workspaces to deploy a f...
Hello, I'm developing a Flutter application and I would like to leverage dart pub workspaces to deploy a function with a dart runtime as advertised here : http...
- [SOLVED] Unable to push function from AP...
When trying to push functions from Gitlab CI (with an API KEY and using the CLI), i saw that i was unable to push functions. ``` $ appwrite client --endpoint $...