Quick Start Guide¶
This Quick Start guide will walk you through the process of creating a Backendless API service by editing the service code online using Backendless Console. By the time you finish the guide, you will have a working API service hosted in Backendless. You will be able to experience REST-based method invocations and download generated client SDKs.
- Create a Backendless account if you do not have one. You can register for your free account at https://develop.backendless.com/registration
- Login to Backendless Console and select your app.
- Click the Business Logic icon to enter the server-side code management area.
- Click the CODING menu item and select JS from the language dropdown list as shown below:
- Right click the services node in the tree and select New file.
- Enter a name for the JS file which will contain the service code. For example,
MyService.js
and click CREATE: -
Backendless creates the file and opens it for editing. Paste the following code into the file editor:
class MyService { /** * @param {String} name */ helloWorld( name ) { return "hello " + name; } } Backendless.ServerCode.addService( MyService );
-
The code above is a JavaScript class (
MyService
) with a method (helloWorld
). Notice the@param
annotation in the JS code comment. The annotation describes to Backendless the type(s) for the method argument(s). Click the Save and Deploy icon/button to deploy the code to Backendless. - Once the code is deployed, Backendless Console will inform you with a notification popup in the upper right corner:
- Click API SERVICES to switch to the service browser screen. The
MyService
service will appear in the list with the first method selected. Enter a value for thename
parameter and click INVOKE. The service method is invoked and console displays the result in the RESPONSE panel: - Click CODE to see a cURL command to invoke the method with the entered values of the parameter. You can copy the entire text of the command and paste in a terminal window to run it outside of the browser:
- Additionally, Backendless generates various client SDKs for the API service. You can learn how to use the generated SDKs in the Client SDKs section.