Hello everyone, I am writing to you because I am having problems putting an API created with wix on RAPID API into production.
I explain quickly:
- I created the "http-function.js" file
- I wrote my api :
export async function get_emotion(request) {
const response = {
"headers": {"Content-Type": "application/json"
}
};
try {
const prompt = request.query["text"];
//make the magic with AI
response.body = prompt;
return ok(response);
} catch (err) {
response.body = {
"error": err. message
};
return badRequest(response);
}
}
- I published the site
- And wow my API WORKS WONDERFUL
If you want to try it and play it to test that it works without problems: https://intelligenzaartificialeitalia .net/_functions/emotion?text=i%20love%20you
the endpoint :
https://intelligenzaartificialeitalia .net/_functions/emotion
add ?text= your text to analyze emotion sentiment of text
Now comes my problem. I had decided (since about 30 of these AI model Inference based APIs) to monetize my APIs on RAPIDAPI.
I configure the endpoint correctly and here's the bad news, it seems that the wix servers don't like calls from RapidApi and in most of the times I don't know which of the two servers returns 503 error.
If you try to click this link: ( https://rapidapi .com/IntelligenzaArtificiale/api/ai-text-emotion-detection ) and try the endpoint you will see that sometimes it works and sometimes it doesn't but it seems impossible to understand why.
https://rapidapi .com/IntelligenzaArtificiale/api/ai-text-emotion-detection
If anyone is interested in trying, even using FREE wix that allows it, refer to these guides:
- https://www.wix .com/velo/reference/getting-started/expose-an-api
- https://www.wix .com/velo/reference/getting-started/give&get-example---exposing-an-api
I hope you can help me, also because it would be very interesting to offer wix users another way to monetize their sites. If we figure out what's wrong, anyone can easily monetize their APIs using wix as hosting. PLEASE HELP ME!
RapidAPI also supports API key rotation for security purposes. You can also use API key rotation to reset a compromised or inadvertently exposed API key without. DNA HRBlock Login