Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var APP_ID = 'B6441196-0A34-10DE-FFA3-8C2D0EB63200';
- var API_KEY = '6D2829D5-54B0-F59D-FF38-137A2148C500';
- Backendless.serverURL = 'https://api.backendless.com';
- Backendless.initApp(APP_ID, API_KEY);
- loginUser();
- function loginUser()
- {
- //login to the system
- Backendless.UserService.login("web@hi.bye","12345",true)
- //what to do when logged in
- .then (function(loggedInUser){
- console.log("user was logged in");
- writeData();
- })
- //what to do when we have an error
- .catch(function(error){
- console.log("Huston we have a problem");
- console.log(error);
- });
- }
- function writeData()
- {
- var myData = {
- name: "Ivgani",
- age: 34,
- isMarried: true,
- children: 3,
- phone: "052-12345678",
- location: "Haifa",
- lastSalary: 81000.02
- }
- Backendless.Data.of("Contact").save(myData)
- //if we was able to write some data to our fucking data base
- .then (function (savedObject){
- console.log("data was saved.....");
- })
- //we have a fucking error
- .catch(function (error)
- {
- console.log("we have a fucking error:");
- console.log(error);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement