I have created it and it's my local machine IPv4 address right?
Yeah right sir, I haven;t any of it
I have created variables in my functions settings
and given access to all
and I have created api key which access functions and databases
I have done everything that mentioned in the documentation. sir
const sdk = require("node-appwrite");
const dotenv = require('dotenv');
dotenv.config();
const { v4:uuidv4} = require('uuid');
const express = require('express');
const app = express();
app.use(express.json());
module.exports = async function (req, res) {
const client = new sdk.Client();
const database = new sdk.Databases(client);
const cartItem = await JSON.parse(req.payload);
const { customer_id, location_id, product_id, seller_id, quantity } = cartItem;
if (
!req.variables['APPWRITE_FUNCTION_ENDPOINT'] ||
!req.variables['APPWRITE_FUNCTION_API_KEY']
) {
console.warn("Environment variables are not set. Function cannot use Appwrite SDK.");
} else {
client
.setEndpoint(req.variables['APPWRITE_FUNCTION_ENDPOINT'])
.setProject(req.variables['APPWRITE_FUNCTION_PROJECT_ID'])
.setKey(req.variables['APPWRITE_FUNCTION_API_KEY'])
.setSelfSigned(true);
let newCartItem = {}
if (customer_id && location_id && product_id && seller_id && quantity) {
try {
newCartItem = await database.createDocument(req.variables['ECOMM_DB_ID'], req.variables['CART_COLLECTION_ID'], uuidv4(), cartItem);
return res.json({
success: true,
error: false,
message: 'New Item is successfully added to cart :)',
data: newCartItem
})
} catch (error) {
return res.json({
success:false,
error: true,
message: error.message
})
}
} else {
res.json({
success:false,
error: true,
message: "All Fields are required :("
})
}
}
res.json({
areDevelopersAwesome: true,
});
};
It would be best to remove them altogether so make sure it doesn't interfere with anything
Try increasing your function timeout to 4 minutes and try executing again
please hold on sir, I am doing what you have suggested. π I think, it's been late night there.
Do I need to give any events?
After I have increased the timeout, I don't know why, It is taking a lot of time to process.
Not if you're executing manually
There's your problem. The endpoint doesn't work
What I need to do sir?
It's my IP
http://192.168.1.4/v1
I have given this
so how do you access your appwrite console?
It worked. Thank you
Operation Timed Out when Executing Function
[SOLVED] Operation Timed Out when Executing Function
APPWRITE_FUNCTION_ENDPOIND = https://cloud.appwrite.io/v1
If anyone faced this issue, this is the endpoint we have to set π
Recommended threads
- Got message for auto payment of 15usd fo...
how did this happen? 1. i claimed my 50usd credits via jsm hackathon - https://hackathon.jsmastery.pro/ 2. it asked me which org. to apply the credits on, i se...
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...