Game API

Standalone API services to communicate with front-end technologies built on HTML5, JavaScript, Unity3D, and Cocos Creator. Encrypted and secured following REST API with WebSocket standards.

Built on REST API protocol, each API endpoint is relative to the base domain/IP URL. If required (Scaleup), multiple servers can be configured for example production, sandbox, maintenance, etc.

By default, the RFC3986 format is followed looks like below:

scheme://host[:port][/path]

It is a choice to keep the host as a domain name or an IP address (IPv4 or IPv6). Socket setup follows WebSocket schemes ws:// and ws:// both. Here are the valid server URLs for APIs.

https://xyz.example.com https://xyz.example.com:8443/v1/reports http://localhost:3025/v1 http://10.0.81.36/v1 ws://xyz.example.com/v1 wss://xyz.example.com/v1 /v1/reports / //xyz.example.com

API Code Deployment - Ubuntu Server

This folder contains source files that are required to build, manage and execute the REST APIs. You can configure settings to expose the data set, and enable local and remote access to the APIs. Follow these guidelines to set up your game APIs. -Put API files inside /home/ubuntu/api-folder-name. -Go inside the folder and run pm2 start js-file-name (pm2 start bin/www --name "poker-api"). -Check pm2 logs for check running or error. -Check-in browser by running URL with port [3015].

As a result, now you are able to connect game APIs to the front app builder.

Code Configuration - Files Update

Now, it's time to configure the code for your domain/IP. Follow the file path instructions to update details. Make sure you edit and save the same file as described here.

Go to Folder: -Api-folder/shared/systemConfig.json -Replace example.com with the real domain name.

Open the file in IDE and search for the webConnectionLink.

"from_email": "[email protected]", "accountMail" : "[email protected]", "clientVer" : "1.0", "protocol" : "https://", "emailHost" : "emailhost.example.com", "gameNameText" : "Project Name", "emailPort" : "3838", "imageUploadHost" : "https://www.example.com:3015", "allowedImagesType" : ["png", "jpg", "jpeg"], "otpValidTime" : 90000, "webConnectionLink" : "https://dashboard.example.com:3838/", "websiteLink" : "https://www.example.com", "sendTransactionMail" : "[email protected],", "websiteReferenceText" : "https://www.example.com", "linkForAppDownload" : " ",

Go to Folder: -Api-folder/config/ keys.js -Replace example.com with the real domain name.

Open the file in IDE and search for the connerctorHost.

configData.rootTools = {}; configData.rootTools.connectorHost = "connector.example.com"; configData.rootTools.connectorPort = "3050"; configData.rootTools.gateHost = "gate.example.com"; configData.rootTools.gatePort = "3014";

Enjoy, for this section the file deployment, and code configuration is completed.

Last updated

Was this helpful?