Question:
I have a backend script that is unable to write to a private database in Live Mode.
Product:
Wix editor and Velo
What are you trying to achieve:
I am building a very simple password manager. I have simplified it to find the error. In this simplified code, I am attempting to save a username given by a user. They enter their username into a text box and click register. I use a backend file to access the database and save the username. In the preview mode, this process works whether the database is public or private. In the live mode, the backend file cannot access the private database.
What have you already tried:
I have tried using a different browser and clearing the cache of each browser. I believe that wicks automatically serves the website on HTTPS so I don’t think this is the problem. My code does not have any obvious errors.
Additional information:
Error Message:
Error saving username: Error: Unable to handle the request. Contact the site administrator or view site monitoring logs for more information.
(anonymous) @ createConsoleProxy.ts:47
Backend test.jsw
// test.jsw
import wixData from ‘wix-data’;
export function saveUsername(username) {
let toInsert = {
“username”: username
};
return wixData.insert(“TestUser”, toInsert);
}